diff --git a/generated/BareMetal/BareMetal.Autorest/Az.BareMetal.csproj b/generated/BareMetal/BareMetal.Autorest/Az.BareMetal.csproj index 0dac7b59ad20..63a5a0bef5f9 100644 --- a/generated/BareMetal/BareMetal.Autorest/Az.BareMetal.csproj +++ b/generated/BareMetal/BareMetal.Autorest/Az.BareMetal.csproj @@ -2,9 +2,9 @@ BareMetal BareMetal + BareMetal.Autorest - diff --git a/generated/BareMetal/BareMetal.Autorest/Az.BareMetal.format.ps1xml b/generated/BareMetal/BareMetal.Autorest/Az.BareMetal.format.ps1xml index 834b5b2a3569..a1d3aa02865a 100644 --- a/generated/BareMetal/BareMetal.Autorest/Az.BareMetal.format.ps1xml +++ b/generated/BareMetal/BareMetal.Autorest/Az.BareMetal.format.ps1xml @@ -2,43 +2,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.BareMetalIdentity + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.AzureBareMetalInstance - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.BareMetalIdentity - - - - - - - - - - - - - - - - - - AzureBareMetalInstanceName - - - ResourceGroupName - - - SubscriptionId - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.AzureBareMetalInstance - - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.AzureBareMetalInstance + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.AzureBareMetalInstance#Multiple @@ -70,9 +36,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.AzureBareMetalInstanceProperties + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.AzureBareMetalInstanceProperties - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.AzureBareMetalInstanceProperties + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.AzureBareMetalInstanceProperties#Multiple @@ -122,9 +88,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.AzureBareMetalInstancesListResult + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.AzureBareMetalInstancesListResult - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.AzureBareMetalInstancesListResult + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.AzureBareMetalInstancesListResult#Multiple @@ -144,9 +110,43 @@ - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.Disk + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.BareMetalIdentity + + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.BareMetalIdentity#Multiple + + + + + + + + + + + + + + + + + + AzureBareMetalInstanceName + + + ResourceGroupName + + + SubscriptionId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Disk - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.Disk + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Disk#Multiple @@ -178,9 +178,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.Display + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Display - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.Display + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Display#Multiple @@ -218,9 +218,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ErrorDefinition + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ErrorDefinition - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ErrorDefinition + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ErrorDefinition#Multiple @@ -246,9 +246,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.HardwareProfile + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.HardwareProfile - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.HardwareProfile + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.HardwareProfile#Multiple @@ -274,9 +274,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IPAddress + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IPAddress - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IPAddress + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IPAddress#Multiple @@ -296,9 +296,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.NetworkProfile + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.NetworkProfile - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.NetworkProfile + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.NetworkProfile#Multiple @@ -318,9 +318,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.Operation + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Operation - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.Operation + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Operation#Multiple @@ -346,9 +346,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.OSProfile + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.OSProfile - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.OSProfile + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.OSProfile#Multiple @@ -386,43 +386,21 @@ - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.Result - - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.Result - - - - - - - - - - - - SampleProperty - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.StorageProfile + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Resource - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.StorageProfile + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Resource#Multiple - + - NfsIPAddress + Name @@ -430,21 +408,21 @@ - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.Tags + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Result - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.Tags + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Result#Multiple - + - Item + SampleProperty @@ -452,21 +430,21 @@ - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.Resource + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.StorageProfile - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.Resource + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.StorageProfile#Multiple - + - Name + NfsIPAddress @@ -474,9 +452,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.SystemData + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.SystemData - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.SystemData + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.SystemData#Multiple @@ -526,9 +504,31 @@ - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.TrackedResource + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Tags + + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Tags#Multiple + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.TrackedResource - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.TrackedResource + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.TrackedResource#Multiple @@ -554,9 +554,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.TrackedResourceTags + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.TrackedResourceTags - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.TrackedResourceTags + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.TrackedResourceTags#Multiple diff --git a/generated/BareMetal/BareMetal.Autorest/Az.BareMetal.psd1 b/generated/BareMetal/BareMetal.Autorest/Az.BareMetal.psd1 index 7157b7c5c9a9..d6bab1f18dab 100644 --- a/generated/BareMetal/BareMetal.Autorest/Az.BareMetal.psd1 +++ b/generated/BareMetal/BareMetal.Autorest/Az.BareMetal.psd1 @@ -11,8 +11,7 @@ DotNetFrameworkVersion = '4.7.2' RequiredAssemblies = './bin/Az.BareMetal.private.dll' FormatsToProcess = './Az.BareMetal.format.ps1xml' - FunctionsToExport = 'Get-AzBareMetal', 'Update-AzBareMetal', '*' - AliasesToExport = '*' + FunctionsToExport = 'Get-AzBareMetal', 'Update-AzBareMetal' PrivateData = @{ PSData = @{ Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'BareMetal' diff --git a/generated/BareMetal/BareMetal.Autorest/Properties/AssemblyInfo.cs b/generated/BareMetal/BareMetal.Autorest/Properties/AssemblyInfo.cs index ce399c32337c..e586f0297925 100644 --- a/generated/BareMetal/BareMetal.Autorest/Properties/AssemblyInfo.cs +++ b/generated/BareMetal/BareMetal.Autorest/Properties/AssemblyInfo.cs @@ -1,28 +1,26 @@ -// ---------------------------------------------------------------------------------- -// -// Copyright Microsoft Corporation -// Licensed under the Apache License, Version 2.0 (the "License"); +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the Apache License, Version 2.0 (the ""License""); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, +// distributed under the License is distributed on an ""AS IS"" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// ---------------------------------------------------------------------------------- +// Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code +// is regenerated. using System; using System.Reflection; +using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -[assembly: AssemblyTitle("Microsoft Azure Powershell - BareMetal")] -[assembly: AssemblyCompany(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCompany)] -[assembly: AssemblyProduct(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyProduct)] -[assembly: AssemblyCopyright(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCopyright)] - -[assembly: ComVisible(false)] -[assembly: CLSCompliant(false)] -[assembly: Guid("92dfcf97-b78e-4e41-89a2-c1f4743fa363")] -[assembly: AssemblyVersion("0.1.2")] -[assembly: AssemblyFileVersion("0.1.2")] +[assembly: System.Reflection.AssemblyCompanyAttribute("Microsoft")] +[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")] +[assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")] +[assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - BareMetal")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("0.1.2")] +[assembly: System.Reflection.AssemblyVersionAttribute("0.1.2")] +[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)] +[assembly: System.CLSCompliantAttribute(false)] diff --git a/generated/BareMetal/BareMetal.Autorest/check-dependencies.ps1 b/generated/BareMetal/BareMetal.Autorest/check-dependencies.ps1 index c29591c7bfe1..90ca9867ae40 100644 --- a/generated/BareMetal/BareMetal.Autorest/check-dependencies.ps1 +++ b/generated/BareMetal/BareMetal.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/BareMetal/BareMetal.Autorest/exports/Get-AzBareMetal.ps1 b/generated/BareMetal/BareMetal.Autorest/exports/Get-AzBareMetal.ps1 index 73cdea400528..8816962c0ceb 100644 --- a/generated/BareMetal/BareMetal.Autorest/exports/Get-AzBareMetal.ps1 +++ b/generated/BareMetal/BareMetal.Autorest/exports/Get-AzBareMetal.ps1 @@ -27,12 +27,12 @@ Get-AzBareMetal -Name oelnvmetest -ResourceGroupName SAT09A-T230 Get-AzBareMetal -ResourceGroupName MWH03A-T210 .Outputs -Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstance +Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstance .Link https://learn.microsoft.com/powershell/module/az.baremetal/get-azbaremetal #> function Get-AzBareMetal { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstance])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstance])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -113,6 +113,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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() @@ -136,9 +145,7 @@ begin { List = 'Az.BareMetal.private\Get-AzBareMetal_List'; List1 = 'Az.BareMetal.private\Get-AzBareMetal_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.BareMetal.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 { @@ -152,6 +159,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/BareMetal/BareMetal.Autorest/exports/ProxyCmdletDefinitions.ps1 b/generated/BareMetal/BareMetal.Autorest/exports/ProxyCmdletDefinitions.ps1 index 3587375e5b4a..9108e74f238d 100644 --- a/generated/BareMetal/BareMetal.Autorest/exports/ProxyCmdletDefinitions.ps1 +++ b/generated/BareMetal/BareMetal.Autorest/exports/ProxyCmdletDefinitions.ps1 @@ -27,12 +27,12 @@ Get-AzBareMetal -Name oelnvmetest -ResourceGroupName SAT09A-T230 Get-AzBareMetal -ResourceGroupName MWH03A-T210 .Outputs -Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstance +Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstance .Link https://learn.microsoft.com/powershell/module/az.baremetal/get-azbaremetal #> function Get-AzBareMetal { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstance])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstance])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -113,6 +113,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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() @@ -136,9 +145,7 @@ begin { List = 'Az.BareMetal.private\Get-AzBareMetal_List'; List1 = 'Az.BareMetal.private\Get-AzBareMetal_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.BareMetal.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 { @@ -152,6 +159,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 +218,7 @@ Get-AzBareMetal -Name oraclerac53 -ResourceGroupName SAT09A-T530 | Update-AzBare .Inputs Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IBareMetalIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstance +Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstance .Notes COMPLEX PARAMETER PROPERTIES @@ -223,10 +233,12 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.baremetal/update-azbaremetal #> function Update-AzBareMetal { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstance])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstance])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Alias('AzureBareMetalInstanceName')] [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category('Path')] [System.String] @@ -234,6 +246,8 @@ param( ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category('Path')] [System.String] # The name of the resource group. @@ -241,6 +255,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -251,16 +267,28 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IBareMetalIdentity] # 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.BareMetal.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags]))] + [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITags]))] [System.Collections.Hashtable] # Tags field of the AzureBareMetal instance. ${Tag}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -317,6 +345,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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() @@ -338,10 +375,10 @@ begin { $mapping = @{ UpdateExpanded = 'Az.BareMetal.private\Update-AzBareMetal_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.BareMetal.private\Update-AzBareMetal_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.BareMetal.private\Update-AzBareMetal_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.BareMetal.private\Update-AzBareMetal_UpdateViaJsonString'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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 { @@ -355,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) diff --git a/generated/BareMetal/BareMetal.Autorest/exports/Update-AzBareMetal.ps1 b/generated/BareMetal/BareMetal.Autorest/exports/Update-AzBareMetal.ps1 index 7e7cfc8c4577..82ba3678715f 100644 --- a/generated/BareMetal/BareMetal.Autorest/exports/Update-AzBareMetal.ps1 +++ b/generated/BareMetal/BareMetal.Autorest/exports/Update-AzBareMetal.ps1 @@ -27,7 +27,7 @@ Get-AzBareMetal -Name oraclerac53 -ResourceGroupName SAT09A-T530 | Update-AzBare .Inputs Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IBareMetalIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstance +Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstance .Notes COMPLEX PARAMETER PROPERTIES @@ -42,10 +42,12 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.baremetal/update-azbaremetal #> function Update-AzBareMetal { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstance])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstance])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Alias('AzureBareMetalInstanceName')] [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category('Path')] [System.String] @@ -53,6 +55,8 @@ param( ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category('Path')] [System.String] # The name of the resource group. @@ -60,6 +64,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -70,16 +76,28 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IBareMetalIdentity] # 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.BareMetal.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags]))] + [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITags]))] [System.Collections.Hashtable] # Tags field of the AzureBareMetal instance. ${Tag}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -136,6 +154,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -157,10 +184,10 @@ begin { $mapping = @{ UpdateExpanded = 'Az.BareMetal.private\Update-AzBareMetal_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.BareMetal.private\Update-AzBareMetal_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.BareMetal.private\Update-AzBareMetal_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.BareMetal.private\Update-AzBareMetal_UpdateViaJsonString'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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 { @@ -174,6 +201,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/BareMetal/BareMetal.Autorest/generate-info.json b/generated/BareMetal/BareMetal.Autorest/generate-info.json index efb7da28df7f..62837e5e7c55 100644 --- a/generated/BareMetal/BareMetal.Autorest/generate-info.json +++ b/generated/BareMetal/BareMetal.Autorest/generate-info.json @@ -1,3 +1,3 @@ { - "generate_Id": "8ac47f73-2bd8-4c01-9857-c8ec51d7cae3" + "generate_Id": "44b7941b-5824-4f02-963b-daffa3df1e89" } diff --git a/generated/BareMetal/BareMetal.Autorest/generated/Module.cs b/generated/BareMetal/BareMetal.Autorest/generated/Module.cs index e81fa874a75a..82ea39ec2b76 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/Module.cs +++ b/generated/BareMetal/BareMetal.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.BareMetal.Module _instance; + /// the ISendAsync pipeline instance private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.HttpPipeline _pipeline; /// the ISendAsync pipeline instance (when proxy is enabled) private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.HttpPipeline _pipelineWithProxy; + private static readonly global::System.Object _singletonLock = new global::System.Object(); + public bool _useProxy = false; public global::System.Net.WebProxy _webProxy = new global::System.Net.WebProxy(); @@ -56,11 +64,8 @@ public partial class Module /// The delegate to get the telemetry info. public GetTelemetryInfoDelegate GetTelemetryInfo { get; set; } - /// Backing field for property. - private static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Module _instance; - /// the singleton of this module class - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Module Instance => Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Module._instance?? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Module._instance = new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Module()); + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal"; @@ -125,9 +130,17 @@ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.HttpPipeline CreateP /// 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/BareMetal/BareMetal.Autorest/generated/api/BareMetal.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/BareMetal.cs index 649c82d2837a..08d1241f9a61 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/BareMetal.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/BareMetal.cs @@ -28,7 +28,7 @@ public partial class BareMetal /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task AzureBareMetalInstancesGet(string subscriptionId, string resourceGroupName, string azureBareMetalInstanceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AzureBareMetalInstancesGet(string subscriptionId, string resourceGroupName, string azureBareMetalInstanceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.ISendAsync sender) { var apiVersion = @"2021-08-09"; // Constant Parameters @@ -55,7 +55,7 @@ public partial class BareMetal await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.AzureBareMetalInstancesGet_Call(request,onOk,onDefault,eventListener,sender); + await this.AzureBareMetalInstancesGet_Call (request, onOk,onDefault,eventListener,sender); } } @@ -71,7 +71,7 @@ public partial class BareMetal /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task AzureBareMetalInstancesGetViaIdentity(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.BareMetal.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AzureBareMetalInstancesGetViaIdentity(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.BareMetal.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.ISendAsync sender) { var apiVersion = @"2021-08-09"; // Constant Parameters @@ -110,11 +110,169 @@ public partial class BareMetal await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.AzureBareMetalInstancesGet_Call(request,onOk,onDefault,eventListener,sender); + await this.AzureBareMetalInstancesGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. + /// + /// Gets an Azure BareMetal instance for the specified subscription, resource group, and instance name. + /// + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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 AzureBareMetalInstancesGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-08-09"; + // 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.BareMetalInfrastructure/bareMetalInstances/(?[^/]+)$", 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.BareMetalInfrastructure/bareMetalInstances/{azureBareMetalInstanceName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var azureBareMetalInstanceName = _match.Groups["azureBareMetalInstanceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.BareMetalInfrastructure/bareMetalInstances/" + + azureBareMetalInstanceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.AzureBareMetalInstancesGetWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Gets an Azure BareMetal instance for the specified subscription, resource group, and instance name. + /// + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the Azure BareMetal on Azure instance. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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 AzureBareMetalInstancesGetWithResult(string subscriptionId, string resourceGroupName, string azureBareMetalInstanceName, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-08-09"; + // 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.BareMetalInfrastructure/bareMetalInstances/" + + global::System.Uri.EscapeDataString(azureBareMetalInstanceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.AzureBareMetalInstancesGetWithResult_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.BareMetal.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 AzureBareMetalInstancesGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.AzureBareMetalInstance.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.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.BareMetal.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 @@ -124,7 +282,7 @@ public partial class BareMetal /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task AzureBareMetalInstancesGet_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.BareMetal.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task AzureBareMetalInstancesGet_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.BareMetal.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -135,6 +293,7 @@ public partial class BareMetal await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -142,13 +301,13 @@ public partial class BareMetal case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.AzureBareMetalInstance.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.AzureBareMetalInstance.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -201,7 +360,7 @@ public partial class BareMetal /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task AzureBareMetalInstancesListByResourceGroup(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.BareMetal.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AzureBareMetalInstancesListByResourceGroup(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.BareMetal.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.ISendAsync sender) { var apiVersion = @"2021-08-09"; // Constant Parameters @@ -227,7 +386,7 @@ public partial class BareMetal await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.AzureBareMetalInstancesListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + await this.AzureBareMetalInstancesListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); } } @@ -244,7 +403,7 @@ public partial class BareMetal /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task AzureBareMetalInstancesListByResourceGroupViaIdentity(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.BareMetal.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AzureBareMetalInstancesListByResourceGroupViaIdentity(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.BareMetal.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.ISendAsync sender) { var apiVersion = @"2021-08-09"; // Constant Parameters @@ -281,12 +440,168 @@ public partial class BareMetal await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.AzureBareMetalInstancesListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + await this.AzureBareMetalInstancesListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets a list of AzureBareMetal instances in the specified subscription and resource group. The operations returns various + /// properties of each Azure BareMetal instance. + /// + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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 AzureBareMetalInstancesListByResourceGroupViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-08-09"; + // 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.BareMetalInfrastructure/bareMetalInstances$", 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.BareMetalInfrastructure/bareMetalInstances'"); + } + + // 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.BareMetalInfrastructure/bareMetalInstances" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.AzureBareMetalInstancesListByResourceGroupWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Gets a list of AzureBareMetal instances in the specified subscription and resource group. The operations returns various + /// properties of each Azure BareMetal instance. + /// + /// 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.BareMetal.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 AzureBareMetalInstancesListByResourceGroupWithResult(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-08-09"; + // 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.BareMetalInfrastructure/bareMetalInstances" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.AzureBareMetalInstancesListByResourceGroupWithResult_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.BareMetal.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 AzureBareMetalInstancesListByResourceGroupWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.AzureBareMetalInstancesListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.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.BareMetal.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). @@ -297,7 +612,7 @@ public partial class BareMetal /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task AzureBareMetalInstancesListByResourceGroup_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.BareMetal.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task AzureBareMetalInstancesListByResourceGroup_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.BareMetal.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -308,6 +623,7 @@ public partial class BareMetal await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -315,13 +631,13 @@ public partial class BareMetal case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.AzureBareMetalInstancesListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.AzureBareMetalInstancesListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -371,7 +687,7 @@ public partial class BareMetal /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task AzureBareMetalInstancesListBySubscription(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AzureBareMetalInstancesListBySubscription(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.ISendAsync sender) { var apiVersion = @"2021-08-09"; // Constant Parameters @@ -395,7 +711,7 @@ public partial class BareMetal await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.AzureBareMetalInstancesListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + await this.AzureBareMetalInstancesListBySubscription_Call (request, onOk,onDefault,eventListener,sender); } } @@ -412,7 +728,7 @@ public partial class BareMetal /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task AzureBareMetalInstancesListBySubscriptionViaIdentity(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.BareMetal.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AzureBareMetalInstancesListBySubscriptionViaIdentity(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.BareMetal.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.ISendAsync sender) { var apiVersion = @"2021-08-09"; // Constant Parameters @@ -446,47 +762,198 @@ public partial class BareMetal await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.AzureBareMetalInstancesListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + await this.AzureBareMetalInstancesListBySubscription_Call (request, onOk,onDefault,eventListener,sender); } } /// - /// Actual wire call for method. + /// Gets a list of AzureBareMetal instances in the specified subscription. The operations returns various properties of each + /// Azure BareMetal instance. /// - /// 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.BareMetal.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 AzureBareMetalInstancesListBySubscription_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.BareMetal.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AzureBareMetalInstancesListBySubscriptionViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.ISendAsync sender) { + var apiVersion = @"2021-08-09"; + // 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.BareMetal.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // verify that Identity format is an exact match for uri - switch ( _response.StatusCode ) + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.BareMetalInfrastructure/bareMetalInstances$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.BareMetalInfrastructure/bareMetalInstances'"); + } + + // 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.BareMetalInfrastructure/bareMetalInstances" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.AzureBareMetalInstancesListBySubscriptionWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Gets a list of AzureBareMetal instances in the specified subscription. The operations returns various properties of each + /// Azure BareMetal instance. + /// + /// The ID of the target subscription. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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 AzureBareMetalInstancesListBySubscriptionWithResult(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-08-09"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.BareMetalInfrastructure/bareMetalInstances" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.AzureBareMetalInstancesListBySubscriptionWithResult_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.BareMetal.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 AzureBareMetalInstancesListBySubscriptionWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.AzureBareMetalInstancesListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.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.BareMetal.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.BareMetal.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 AzureBareMetalInstancesListBySubscription_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.BareMetal.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.AzureBareMetalInstancesListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.AzureBareMetalInstancesListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -531,10 +998,11 @@ public partial class BareMetal /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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 AzureBareMetalInstancesUpdate(string subscriptionId, string resourceGroupName, string azureBareMetalInstanceName, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags1 body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AzureBareMetalInstancesUpdate(string subscriptionId, string resourceGroupName, string azureBareMetalInstanceName, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITags1 body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2021-08-09"; // Constant Parameters @@ -561,11 +1029,11 @@ public partial class BareMetal await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.AzureBareMetalInstancesUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.AzureBareMetalInstancesUpdate_Call (request, onOk,onDefault,eventListener,sender); } } @@ -579,10 +1047,11 @@ public partial class BareMetal /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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 AzureBareMetalInstancesUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags1 body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AzureBareMetalInstancesUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITags1 body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2021-08-09"; // Constant Parameters @@ -621,15 +1090,283 @@ public partial class BareMetal await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.AzureBareMetalInstancesUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.AzureBareMetalInstancesUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Patches the Tags field of a Azure BareMetal instance for the specified subscription, resource group, and instance name. + /// + /// + /// Request body that only contains the new Tags field + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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 AzureBareMetalInstancesUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITags1 body, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2021-08-09"; + // 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.BareMetalInfrastructure/bareMetalInstances/(?[^/]+)$", 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.BareMetalInfrastructure/bareMetalInstances/{azureBareMetalInstanceName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var azureBareMetalInstanceName = _match.Groups["azureBareMetalInstanceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.BareMetalInfrastructure/bareMetalInstances/" + + azureBareMetalInstanceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.AzureBareMetalInstancesUpdateWithResult_Call (request, eventListener,sender); } } - /// Actual wire call for method. + /// + /// Patches the Tags field of a Azure BareMetal instance for the specified subscription, resource group, and instance name. + /// + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the Azure BareMetal on Azure instance. + /// Json string supplied to the AzureBareMetalInstancesUpdate 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.BareMetal.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 AzureBareMetalInstancesUpdateViaJsonString(string subscriptionId, string resourceGroupName, string azureBareMetalInstanceName, 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.BareMetal.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-08-09"; + // 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.BareMetalInfrastructure/bareMetalInstances/" + + global::System.Uri.EscapeDataString(azureBareMetalInstanceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AzureBareMetalInstancesUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Patches the Tags field of a Azure BareMetal instance for the specified subscription, resource group, and instance name. + /// + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the Azure BareMetal on Azure instance. + /// Json string supplied to the AzureBareMetalInstancesUpdate operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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 AzureBareMetalInstancesUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string azureBareMetalInstanceName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-08-09"; + // 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.BareMetalInfrastructure/bareMetalInstances/" + + global::System.Uri.EscapeDataString(azureBareMetalInstanceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.AzureBareMetalInstancesUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Patches the Tags field of a Azure BareMetal instance for the specified subscription, resource group, and instance name. + /// + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the Azure BareMetal on Azure instance. + /// Request body that only contains the new Tags field + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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 AzureBareMetalInstancesUpdateWithResult(string subscriptionId, string resourceGroupName, string azureBareMetalInstanceName, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITags1 body, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2021-08-09"; + // 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.BareMetalInfrastructure/bareMetalInstances/" + + global::System.Uri.EscapeDataString(azureBareMetalInstanceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.AzureBareMetalInstancesUpdateWithResult_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.BareMetal.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 AzureBareMetalInstancesUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.AzureBareMetalInstance.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.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.BareMetal.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 @@ -639,7 +1376,7 @@ public partial class BareMetal /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task AzureBareMetalInstancesUpdate_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.BareMetal.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task AzureBareMetalInstancesUpdate_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.BareMetal.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -650,6 +1387,7 @@ public partial class BareMetal await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -657,13 +1395,13 @@ public partial class BareMetal case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.AzureBareMetalInstance.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.AzureBareMetalInstance.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -690,7 +1428,7 @@ public partial class BareMetal /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task AzureBareMetalInstancesUpdate_Validate(string subscriptionId, string resourceGroupName, string azureBareMetalInstanceName, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags1 body, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task AzureBareMetalInstancesUpdate_Validate(string subscriptionId, string resourceGroupName, string azureBareMetalInstanceName, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITags1 body, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -714,7 +1452,7 @@ public partial class BareMetal /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task OperationsList(global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task OperationsList(global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.ISendAsync sender) { var apiVersion = @"2021-08-09"; // Constant Parameters @@ -736,7 +1474,7 @@ public partial class BareMetal await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.OperationsList_Call(request,onOk,onDefault,eventListener,sender); + await this.OperationsList_Call (request, onOk,onDefault,eventListener,sender); } } @@ -750,7 +1488,7 @@ public partial class BareMetal /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task OperationsListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task OperationsListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.ISendAsync sender) { var apiVersion = @"2021-08-09"; // Constant Parameters @@ -781,11 +1519,147 @@ public partial class BareMetal await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.OperationsList_Call(request,onOk,onDefault,eventListener,sender); + await this.OperationsList_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Gets a list of AzureBareMetal management operations. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OperationsListViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-08-09"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.BareMetalInfrastructure/operations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.BareMetalInfrastructure/operations'"); + } + + // replace URI parameters with values from identity + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.BareMetalInfrastructure/operations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.OperationsListWithResult_Call (request, eventListener,sender); + } + } + + /// Gets a list of AzureBareMetal management operations. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OperationsListWithResult(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-08-09"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.BareMetalInfrastructure/operations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.OperationsListWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task OperationsListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.OperationList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.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.BareMetal.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 @@ -795,7 +1669,7 @@ public partial class BareMetal /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task OperationsList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task OperationsList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -806,6 +1680,7 @@ public partial class BareMetal await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -813,13 +1688,13 @@ public partial class BareMetal case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.OperationList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.OperationList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/AzureBareMetalInstance.PowerShell.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/AzureBareMetalInstance.PowerShell.cs deleted file mode 100644 index c03126cd33ab..000000000000 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/AzureBareMetalInstance.PowerShell.cs +++ /dev/null @@ -1,422 +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.BareMetal.Models.Api20210809 -{ - using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell; - - /// - /// AzureBareMetal instance info on Azure (ARM properties and AzureBareMetal properties) - /// - [System.ComponentModel.TypeConverter(typeof(AzureBareMetalInstanceTypeConverter))] - public partial class AzureBareMetalInstance - { - - /// - /// 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 AzureBareMetalInstance(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.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.AzureBareMetalInstancePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.TrackedResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("HardwareProfile")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).HardwareProfile = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfile) content.GetValueForProperty("HardwareProfile",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).HardwareProfile, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.HardwareProfileTypeConverter.ConvertFrom); - } - if (content.Contains("StorageProfile")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).StorageProfile = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IStorageProfile) content.GetValueForProperty("StorageProfile",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).StorageProfile, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.StorageProfileTypeConverter.ConvertFrom); - } - if (content.Contains("OSProfile")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).OSProfile = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfile) content.GetValueForProperty("OSProfile",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).OSProfile, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.OSProfileTypeConverter.ConvertFrom); - } - if (content.Contains("NetworkProfile")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).NetworkProfile = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.INetworkProfile) content.GetValueForProperty("NetworkProfile",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).NetworkProfile, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.NetworkProfileTypeConverter.ConvertFrom); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)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("AzureBareMetalInstanceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).AzureBareMetalInstanceId = (string) content.GetValueForProperty("AzureBareMetalInstanceId",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).AzureBareMetalInstanceId, global::System.Convert.ToString); - } - if (content.Contains("PowerState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).PowerState = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstancePowerStateEnum?) content.GetValueForProperty("PowerState",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).PowerState, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstancePowerStateEnum.CreateFrom); - } - if (content.Contains("ProximityPlacementGroup")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).ProximityPlacementGroup = (string) content.GetValueForProperty("ProximityPlacementGroup",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).ProximityPlacementGroup, global::System.Convert.ToString); - } - if (content.Contains("HwRevision")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).HwRevision = (string) content.GetValueForProperty("HwRevision",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).HwRevision, global::System.Convert.ToString); - } - if (content.Contains("PartnerNodeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).PartnerNodeId = (string) content.GetValueForProperty("PartnerNodeId",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).PartnerNodeId, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalProvisioningStatesEnum?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalProvisioningStatesEnum.CreateFrom); - } - if (content.Contains("StorageProfileOSDisk")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).StorageProfileOSDisk = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisk[]) content.GetValueForProperty("StorageProfileOSDisk",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).StorageProfileOSDisk, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.DiskTypeConverter.ConvertFrom)); - } - if (content.Contains("NetworkProfileNetworkInterface")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).NetworkProfileNetworkInterface = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IIPAddress[]) content.GetValueForProperty("NetworkProfileNetworkInterface",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).NetworkProfileNetworkInterface, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IPAddressTypeConverter.ConvertFrom)); - } - if (content.Contains("NetworkProfileCircuitId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).NetworkProfileCircuitId = (string) content.GetValueForProperty("NetworkProfileCircuitId",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).NetworkProfileCircuitId, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)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("HardwareProfileHardwareType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).HardwareProfileHardwareType = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum?) content.GetValueForProperty("HardwareProfileHardwareType",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).HardwareProfileHardwareType, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum.CreateFrom); - } - if (content.Contains("HardwareProfileAzureBareMetalInstanceSize")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).HardwareProfileAzureBareMetalInstanceSize = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum?) content.GetValueForProperty("HardwareProfileAzureBareMetalInstanceSize",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).HardwareProfileAzureBareMetalInstanceSize, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum.CreateFrom); - } - if (content.Contains("StorageProfileNfsIPAddress")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).StorageProfileNfsIPAddress = (string) content.GetValueForProperty("StorageProfileNfsIPAddress",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).StorageProfileNfsIPAddress, global::System.Convert.ToString); - } - if (content.Contains("OSProfileComputerName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).OSProfileComputerName = (string) content.GetValueForProperty("OSProfileComputerName",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).OSProfileComputerName, global::System.Convert.ToString); - } - if (content.Contains("OSProfileOstype")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).OSProfileOstype = (string) content.GetValueForProperty("OSProfileOstype",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).OSProfileOstype, global::System.Convert.ToString); - } - if (content.Contains("OSProfileVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).OSProfileVersion = (string) content.GetValueForProperty("OSProfileVersion",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).OSProfileVersion, global::System.Convert.ToString); - } - if (content.Contains("OSProfileSshPublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).OSProfileSshPublicKey = (string) content.GetValueForProperty("OSProfileSshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).OSProfileSshPublicKey, 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 AzureBareMetalInstance(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.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.AzureBareMetalInstancePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.TrackedResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("HardwareProfile")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).HardwareProfile = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfile) content.GetValueForProperty("HardwareProfile",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).HardwareProfile, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.HardwareProfileTypeConverter.ConvertFrom); - } - if (content.Contains("StorageProfile")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).StorageProfile = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IStorageProfile) content.GetValueForProperty("StorageProfile",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).StorageProfile, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.StorageProfileTypeConverter.ConvertFrom); - } - if (content.Contains("OSProfile")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).OSProfile = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfile) content.GetValueForProperty("OSProfile",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).OSProfile, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.OSProfileTypeConverter.ConvertFrom); - } - if (content.Contains("NetworkProfile")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).NetworkProfile = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.INetworkProfile) content.GetValueForProperty("NetworkProfile",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).NetworkProfile, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.NetworkProfileTypeConverter.ConvertFrom); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)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("AzureBareMetalInstanceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).AzureBareMetalInstanceId = (string) content.GetValueForProperty("AzureBareMetalInstanceId",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).AzureBareMetalInstanceId, global::System.Convert.ToString); - } - if (content.Contains("PowerState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).PowerState = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstancePowerStateEnum?) content.GetValueForProperty("PowerState",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).PowerState, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstancePowerStateEnum.CreateFrom); - } - if (content.Contains("ProximityPlacementGroup")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).ProximityPlacementGroup = (string) content.GetValueForProperty("ProximityPlacementGroup",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).ProximityPlacementGroup, global::System.Convert.ToString); - } - if (content.Contains("HwRevision")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).HwRevision = (string) content.GetValueForProperty("HwRevision",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).HwRevision, global::System.Convert.ToString); - } - if (content.Contains("PartnerNodeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).PartnerNodeId = (string) content.GetValueForProperty("PartnerNodeId",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).PartnerNodeId, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalProvisioningStatesEnum?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalProvisioningStatesEnum.CreateFrom); - } - if (content.Contains("StorageProfileOSDisk")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).StorageProfileOSDisk = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisk[]) content.GetValueForProperty("StorageProfileOSDisk",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).StorageProfileOSDisk, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.DiskTypeConverter.ConvertFrom)); - } - if (content.Contains("NetworkProfileNetworkInterface")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).NetworkProfileNetworkInterface = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IIPAddress[]) content.GetValueForProperty("NetworkProfileNetworkInterface",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).NetworkProfileNetworkInterface, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IPAddressTypeConverter.ConvertFrom)); - } - if (content.Contains("NetworkProfileCircuitId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).NetworkProfileCircuitId = (string) content.GetValueForProperty("NetworkProfileCircuitId",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).NetworkProfileCircuitId, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)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("HardwareProfileHardwareType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).HardwareProfileHardwareType = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum?) content.GetValueForProperty("HardwareProfileHardwareType",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).HardwareProfileHardwareType, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum.CreateFrom); - } - if (content.Contains("HardwareProfileAzureBareMetalInstanceSize")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).HardwareProfileAzureBareMetalInstanceSize = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum?) content.GetValueForProperty("HardwareProfileAzureBareMetalInstanceSize",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).HardwareProfileAzureBareMetalInstanceSize, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum.CreateFrom); - } - if (content.Contains("StorageProfileNfsIPAddress")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).StorageProfileNfsIPAddress = (string) content.GetValueForProperty("StorageProfileNfsIPAddress",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).StorageProfileNfsIPAddress, global::System.Convert.ToString); - } - if (content.Contains("OSProfileComputerName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).OSProfileComputerName = (string) content.GetValueForProperty("OSProfileComputerName",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).OSProfileComputerName, global::System.Convert.ToString); - } - if (content.Contains("OSProfileOstype")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).OSProfileOstype = (string) content.GetValueForProperty("OSProfileOstype",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).OSProfileOstype, global::System.Convert.ToString); - } - if (content.Contains("OSProfileVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).OSProfileVersion = (string) content.GetValueForProperty("OSProfileVersion",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).OSProfileVersion, global::System.Convert.ToString); - } - if (content.Contains("OSProfileSshPublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).OSProfileSshPublicKey = (string) content.GetValueForProperty("OSProfileSshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).OSProfileSshPublicKey, global::System.Convert.ToString); - } - AfterDeserializePSObject(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstance DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new AzureBareMetalInstance(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.BareMetal.Models.Api20210809.IAzureBareMetalInstance DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new AzureBareMetalInstance(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.BareMetal.Models.Api20210809.IAzureBareMetalInstance FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.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(); - } - } - /// AzureBareMetal instance info on Azure (ARM properties and AzureBareMetal properties) - [System.ComponentModel.TypeConverter(typeof(AzureBareMetalInstanceTypeConverter))] - public partial interface IAzureBareMetalInstance - - { - - } -} \ No newline at end of file diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/AzureBareMetalInstanceProperties.PowerShell.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/AzureBareMetalInstanceProperties.PowerShell.cs deleted file mode 100644 index cc28a3c9ee39..000000000000 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/AzureBareMetalInstanceProperties.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.BareMetal.Models.Api20210809 -{ - using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell; - - /// Describes the properties of an AzureBareMetal instance. - [System.ComponentModel.TypeConverter(typeof(AzureBareMetalInstancePropertiesTypeConverter))] - public partial class AzureBareMetalInstanceProperties - { - - /// - /// 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 AzureBareMetalInstanceProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("HardwareProfile")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).HardwareProfile = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfile) content.GetValueForProperty("HardwareProfile",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).HardwareProfile, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.HardwareProfileTypeConverter.ConvertFrom); - } - if (content.Contains("StorageProfile")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).StorageProfile = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IStorageProfile) content.GetValueForProperty("StorageProfile",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).StorageProfile, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.StorageProfileTypeConverter.ConvertFrom); - } - if (content.Contains("OSProfile")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).OSProfile = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfile) content.GetValueForProperty("OSProfile",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).OSProfile, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.OSProfileTypeConverter.ConvertFrom); - } - if (content.Contains("NetworkProfile")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).NetworkProfile = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.INetworkProfile) content.GetValueForProperty("NetworkProfile",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).NetworkProfile, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.NetworkProfileTypeConverter.ConvertFrom); - } - if (content.Contains("AzureBareMetalInstanceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).AzureBareMetalInstanceId = (string) content.GetValueForProperty("AzureBareMetalInstanceId",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).AzureBareMetalInstanceId, global::System.Convert.ToString); - } - if (content.Contains("PowerState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).PowerState = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstancePowerStateEnum?) content.GetValueForProperty("PowerState",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).PowerState, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstancePowerStateEnum.CreateFrom); - } - if (content.Contains("ProximityPlacementGroup")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).ProximityPlacementGroup = (string) content.GetValueForProperty("ProximityPlacementGroup",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).ProximityPlacementGroup, global::System.Convert.ToString); - } - if (content.Contains("HwRevision")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).HwRevision = (string) content.GetValueForProperty("HwRevision",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).HwRevision, global::System.Convert.ToString); - } - if (content.Contains("PartnerNodeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).PartnerNodeId = (string) content.GetValueForProperty("PartnerNodeId",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).PartnerNodeId, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalProvisioningStatesEnum?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalProvisioningStatesEnum.CreateFrom); - } - if (content.Contains("StorageProfileOSDisk")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).StorageProfileOSDisk = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisk[]) content.GetValueForProperty("StorageProfileOSDisk",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).StorageProfileOSDisk, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.DiskTypeConverter.ConvertFrom)); - } - if (content.Contains("NetworkProfileNetworkInterface")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).NetworkProfileNetworkInterface = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IIPAddress[]) content.GetValueForProperty("NetworkProfileNetworkInterface",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).NetworkProfileNetworkInterface, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IPAddressTypeConverter.ConvertFrom)); - } - if (content.Contains("NetworkProfileCircuitId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).NetworkProfileCircuitId = (string) content.GetValueForProperty("NetworkProfileCircuitId",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).NetworkProfileCircuitId, global::System.Convert.ToString); - } - if (content.Contains("HardwareProfileHardwareType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).HardwareProfileHardwareType = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum?) content.GetValueForProperty("HardwareProfileHardwareType",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).HardwareProfileHardwareType, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum.CreateFrom); - } - if (content.Contains("HardwareProfileAzureBareMetalInstanceSize")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).HardwareProfileAzureBareMetalInstanceSize = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum?) content.GetValueForProperty("HardwareProfileAzureBareMetalInstanceSize",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).HardwareProfileAzureBareMetalInstanceSize, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum.CreateFrom); - } - if (content.Contains("StorageProfileNfsIPAddress")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).StorageProfileNfsIPAddress = (string) content.GetValueForProperty("StorageProfileNfsIPAddress",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).StorageProfileNfsIPAddress, global::System.Convert.ToString); - } - if (content.Contains("OSProfileComputerName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).OSProfileComputerName = (string) content.GetValueForProperty("OSProfileComputerName",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).OSProfileComputerName, global::System.Convert.ToString); - } - if (content.Contains("OSProfileOstype")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).OSProfileOstype = (string) content.GetValueForProperty("OSProfileOstype",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).OSProfileOstype, global::System.Convert.ToString); - } - if (content.Contains("OSProfileVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).OSProfileVersion = (string) content.GetValueForProperty("OSProfileVersion",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).OSProfileVersion, global::System.Convert.ToString); - } - if (content.Contains("OSProfileSshPublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).OSProfileSshPublicKey = (string) content.GetValueForProperty("OSProfileSshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).OSProfileSshPublicKey, 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 AzureBareMetalInstanceProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("HardwareProfile")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).HardwareProfile = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfile) content.GetValueForProperty("HardwareProfile",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).HardwareProfile, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.HardwareProfileTypeConverter.ConvertFrom); - } - if (content.Contains("StorageProfile")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).StorageProfile = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IStorageProfile) content.GetValueForProperty("StorageProfile",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).StorageProfile, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.StorageProfileTypeConverter.ConvertFrom); - } - if (content.Contains("OSProfile")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).OSProfile = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfile) content.GetValueForProperty("OSProfile",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).OSProfile, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.OSProfileTypeConverter.ConvertFrom); - } - if (content.Contains("NetworkProfile")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).NetworkProfile = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.INetworkProfile) content.GetValueForProperty("NetworkProfile",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).NetworkProfile, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.NetworkProfileTypeConverter.ConvertFrom); - } - if (content.Contains("AzureBareMetalInstanceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).AzureBareMetalInstanceId = (string) content.GetValueForProperty("AzureBareMetalInstanceId",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).AzureBareMetalInstanceId, global::System.Convert.ToString); - } - if (content.Contains("PowerState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).PowerState = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstancePowerStateEnum?) content.GetValueForProperty("PowerState",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).PowerState, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstancePowerStateEnum.CreateFrom); - } - if (content.Contains("ProximityPlacementGroup")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).ProximityPlacementGroup = (string) content.GetValueForProperty("ProximityPlacementGroup",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).ProximityPlacementGroup, global::System.Convert.ToString); - } - if (content.Contains("HwRevision")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).HwRevision = (string) content.GetValueForProperty("HwRevision",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).HwRevision, global::System.Convert.ToString); - } - if (content.Contains("PartnerNodeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).PartnerNodeId = (string) content.GetValueForProperty("PartnerNodeId",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).PartnerNodeId, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalProvisioningStatesEnum?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalProvisioningStatesEnum.CreateFrom); - } - if (content.Contains("StorageProfileOSDisk")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).StorageProfileOSDisk = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisk[]) content.GetValueForProperty("StorageProfileOSDisk",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).StorageProfileOSDisk, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.DiskTypeConverter.ConvertFrom)); - } - if (content.Contains("NetworkProfileNetworkInterface")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).NetworkProfileNetworkInterface = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IIPAddress[]) content.GetValueForProperty("NetworkProfileNetworkInterface",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).NetworkProfileNetworkInterface, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IPAddressTypeConverter.ConvertFrom)); - } - if (content.Contains("NetworkProfileCircuitId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).NetworkProfileCircuitId = (string) content.GetValueForProperty("NetworkProfileCircuitId",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).NetworkProfileCircuitId, global::System.Convert.ToString); - } - if (content.Contains("HardwareProfileHardwareType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).HardwareProfileHardwareType = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum?) content.GetValueForProperty("HardwareProfileHardwareType",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).HardwareProfileHardwareType, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum.CreateFrom); - } - if (content.Contains("HardwareProfileAzureBareMetalInstanceSize")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).HardwareProfileAzureBareMetalInstanceSize = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum?) content.GetValueForProperty("HardwareProfileAzureBareMetalInstanceSize",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).HardwareProfileAzureBareMetalInstanceSize, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum.CreateFrom); - } - if (content.Contains("StorageProfileNfsIPAddress")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).StorageProfileNfsIPAddress = (string) content.GetValueForProperty("StorageProfileNfsIPAddress",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).StorageProfileNfsIPAddress, global::System.Convert.ToString); - } - if (content.Contains("OSProfileComputerName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).OSProfileComputerName = (string) content.GetValueForProperty("OSProfileComputerName",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).OSProfileComputerName, global::System.Convert.ToString); - } - if (content.Contains("OSProfileOstype")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).OSProfileOstype = (string) content.GetValueForProperty("OSProfileOstype",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).OSProfileOstype, global::System.Convert.ToString); - } - if (content.Contains("OSProfileVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).OSProfileVersion = (string) content.GetValueForProperty("OSProfileVersion",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).OSProfileVersion, global::System.Convert.ToString); - } - if (content.Contains("OSProfileSshPublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).OSProfileSshPublicKey = (string) content.GetValueForProperty("OSProfileSshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).OSProfileSshPublicKey, global::System.Convert.ToString); - } - AfterDeserializePSObject(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new AzureBareMetalInstanceProperties(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.BareMetal.Models.Api20210809.IAzureBareMetalInstanceProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new AzureBareMetalInstanceProperties(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.BareMetal.Models.Api20210809.IAzureBareMetalInstanceProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.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(); - } - } - /// Describes the properties of an AzureBareMetal instance. - [System.ComponentModel.TypeConverter(typeof(AzureBareMetalInstancePropertiesTypeConverter))] - public partial interface IAzureBareMetalInstanceProperties - - { - - } -} \ No newline at end of file diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/AzureBareMetalInstance.PowerShell.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/AzureBareMetalInstance.PowerShell.cs new file mode 100644 index 000000000000..5b79dfbdb96c --- /dev/null +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/AzureBareMetalInstance.PowerShell.cs @@ -0,0 +1,422 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell; + + /// + /// AzureBareMetal instance info on Azure (ARM properties and AzureBareMetal properties) + /// + [System.ComponentModel.TypeConverter(typeof(AzureBareMetalInstanceTypeConverter))] + public partial class AzureBareMetalInstance + { + + /// + /// 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 AzureBareMetalInstance(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.BareMetal.Models.IAzureBareMetalInstanceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.AzureBareMetalInstancePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("HardwareProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).HardwareProfile = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IHardwareProfile) content.GetValueForProperty("HardwareProfile",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).HardwareProfile, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.HardwareProfileTypeConverter.ConvertFrom); + } + if (content.Contains("StorageProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).StorageProfile = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IStorageProfile) content.GetValueForProperty("StorageProfile",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).StorageProfile, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.StorageProfileTypeConverter.ConvertFrom); + } + if (content.Contains("OSProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).OSProfile = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOSProfile) content.GetValueForProperty("OSProfile",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).OSProfile, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.OSProfileTypeConverter.ConvertFrom); + } + if (content.Contains("NetworkProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).NetworkProfile = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.INetworkProfile) content.GetValueForProperty("NetworkProfile",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).NetworkProfile, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.NetworkProfileTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)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("AzureBareMetalInstanceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).AzureBareMetalInstanceId = (string) content.GetValueForProperty("AzureBareMetalInstanceId",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).AzureBareMetalInstanceId, global::System.Convert.ToString); + } + if (content.Contains("PowerState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).PowerState = (string) content.GetValueForProperty("PowerState",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).PowerState, global::System.Convert.ToString); + } + if (content.Contains("ProximityPlacementGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).ProximityPlacementGroup = (string) content.GetValueForProperty("ProximityPlacementGroup",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).ProximityPlacementGroup, global::System.Convert.ToString); + } + if (content.Contains("HwRevision")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).HwRevision = (string) content.GetValueForProperty("HwRevision",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).HwRevision, global::System.Convert.ToString); + } + if (content.Contains("PartnerNodeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).PartnerNodeId = (string) content.GetValueForProperty("PartnerNodeId",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).PartnerNodeId, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("StorageProfileOSDisk")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).StorageProfileOSDisk = (System.Collections.Generic.List) content.GetValueForProperty("StorageProfileOSDisk",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).StorageProfileOSDisk, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.DiskTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkProfileNetworkInterface")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).NetworkProfileNetworkInterface = (System.Collections.Generic.List) content.GetValueForProperty("NetworkProfileNetworkInterface",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).NetworkProfileNetworkInterface, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IPAddressTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkProfileCircuitId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).NetworkProfileCircuitId = (string) content.GetValueForProperty("NetworkProfileCircuitId",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).NetworkProfileCircuitId, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)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("HardwareProfileHardwareType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).HardwareProfileHardwareType = (string) content.GetValueForProperty("HardwareProfileHardwareType",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).HardwareProfileHardwareType, global::System.Convert.ToString); + } + if (content.Contains("HardwareProfileAzureBareMetalInstanceSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).HardwareProfileAzureBareMetalInstanceSize = (string) content.GetValueForProperty("HardwareProfileAzureBareMetalInstanceSize",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).HardwareProfileAzureBareMetalInstanceSize, global::System.Convert.ToString); + } + if (content.Contains("StorageProfileNfsIPAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).StorageProfileNfsIPAddress = (string) content.GetValueForProperty("StorageProfileNfsIPAddress",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).StorageProfileNfsIPAddress, global::System.Convert.ToString); + } + if (content.Contains("OSProfileComputerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).OSProfileComputerName = (string) content.GetValueForProperty("OSProfileComputerName",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).OSProfileComputerName, global::System.Convert.ToString); + } + if (content.Contains("OSProfileOstype")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).OSProfileOstype = (string) content.GetValueForProperty("OSProfileOstype",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).OSProfileOstype, global::System.Convert.ToString); + } + if (content.Contains("OSProfileVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).OSProfileVersion = (string) content.GetValueForProperty("OSProfileVersion",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).OSProfileVersion, global::System.Convert.ToString); + } + if (content.Contains("OSProfileSshPublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).OSProfileSshPublicKey = (string) content.GetValueForProperty("OSProfileSshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).OSProfileSshPublicKey, 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 AzureBareMetalInstance(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.BareMetal.Models.IAzureBareMetalInstanceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.AzureBareMetalInstancePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("HardwareProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).HardwareProfile = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IHardwareProfile) content.GetValueForProperty("HardwareProfile",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).HardwareProfile, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.HardwareProfileTypeConverter.ConvertFrom); + } + if (content.Contains("StorageProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).StorageProfile = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IStorageProfile) content.GetValueForProperty("StorageProfile",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).StorageProfile, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.StorageProfileTypeConverter.ConvertFrom); + } + if (content.Contains("OSProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).OSProfile = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOSProfile) content.GetValueForProperty("OSProfile",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).OSProfile, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.OSProfileTypeConverter.ConvertFrom); + } + if (content.Contains("NetworkProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).NetworkProfile = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.INetworkProfile) content.GetValueForProperty("NetworkProfile",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).NetworkProfile, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.NetworkProfileTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)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("AzureBareMetalInstanceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).AzureBareMetalInstanceId = (string) content.GetValueForProperty("AzureBareMetalInstanceId",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).AzureBareMetalInstanceId, global::System.Convert.ToString); + } + if (content.Contains("PowerState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).PowerState = (string) content.GetValueForProperty("PowerState",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).PowerState, global::System.Convert.ToString); + } + if (content.Contains("ProximityPlacementGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).ProximityPlacementGroup = (string) content.GetValueForProperty("ProximityPlacementGroup",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).ProximityPlacementGroup, global::System.Convert.ToString); + } + if (content.Contains("HwRevision")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).HwRevision = (string) content.GetValueForProperty("HwRevision",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).HwRevision, global::System.Convert.ToString); + } + if (content.Contains("PartnerNodeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).PartnerNodeId = (string) content.GetValueForProperty("PartnerNodeId",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).PartnerNodeId, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("StorageProfileOSDisk")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).StorageProfileOSDisk = (System.Collections.Generic.List) content.GetValueForProperty("StorageProfileOSDisk",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).StorageProfileOSDisk, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.DiskTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkProfileNetworkInterface")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).NetworkProfileNetworkInterface = (System.Collections.Generic.List) content.GetValueForProperty("NetworkProfileNetworkInterface",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).NetworkProfileNetworkInterface, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IPAddressTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkProfileCircuitId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).NetworkProfileCircuitId = (string) content.GetValueForProperty("NetworkProfileCircuitId",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).NetworkProfileCircuitId, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)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("HardwareProfileHardwareType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).HardwareProfileHardwareType = (string) content.GetValueForProperty("HardwareProfileHardwareType",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).HardwareProfileHardwareType, global::System.Convert.ToString); + } + if (content.Contains("HardwareProfileAzureBareMetalInstanceSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).HardwareProfileAzureBareMetalInstanceSize = (string) content.GetValueForProperty("HardwareProfileAzureBareMetalInstanceSize",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).HardwareProfileAzureBareMetalInstanceSize, global::System.Convert.ToString); + } + if (content.Contains("StorageProfileNfsIPAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).StorageProfileNfsIPAddress = (string) content.GetValueForProperty("StorageProfileNfsIPAddress",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).StorageProfileNfsIPAddress, global::System.Convert.ToString); + } + if (content.Contains("OSProfileComputerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).OSProfileComputerName = (string) content.GetValueForProperty("OSProfileComputerName",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).OSProfileComputerName, global::System.Convert.ToString); + } + if (content.Contains("OSProfileOstype")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).OSProfileOstype = (string) content.GetValueForProperty("OSProfileOstype",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).OSProfileOstype, global::System.Convert.ToString); + } + if (content.Contains("OSProfileVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).OSProfileVersion = (string) content.GetValueForProperty("OSProfileVersion",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).OSProfileVersion, global::System.Convert.ToString); + } + if (content.Contains("OSProfileSshPublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).OSProfileSshPublicKey = (string) content.GetValueForProperty("OSProfileSshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal)this).OSProfileSshPublicKey, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstance DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AzureBareMetalInstance(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.BareMetal.Models.IAzureBareMetalInstance DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AzureBareMetalInstance(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.BareMetal.Models.IAzureBareMetalInstance FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.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(); + } + } + /// AzureBareMetal instance info on Azure (ARM properties and AzureBareMetal properties) + [System.ComponentModel.TypeConverter(typeof(AzureBareMetalInstanceTypeConverter))] + public partial interface IAzureBareMetalInstance + + { + + } +} \ No newline at end of file diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/AzureBareMetalInstance.TypeConverter.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/AzureBareMetalInstance.TypeConverter.cs similarity index 97% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/AzureBareMetalInstance.TypeConverter.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/AzureBareMetalInstance.TypeConverter.cs index 98b832c97a43..6ed2915ba63e 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/AzureBareMetalInstance.TypeConverter.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/AzureBareMetalInstance.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.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Models.Api20210809.IAzureBareMetalInstance ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstance ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstance).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstance).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/AzureBareMetalInstance.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/AzureBareMetalInstance.cs similarity index 53% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/AzureBareMetalInstance.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/AzureBareMetalInstance.cs index c91df0915553..8c50b00f3305 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/AzureBareMetalInstance.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/AzureBareMetalInstance.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions; @@ -11,154 +11,171 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809 /// AzureBareMetal instance info on Azure (ARM properties and AzureBareMetal properties) /// public partial class AzureBareMetalInstance : - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstance, - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal, + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstance, + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.TrackedResource(); + private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.TrackedResource(); /// Specifies the AzureBareMetal instance unique ID. [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)] - public string AzureBareMetalInstanceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).AzureBareMetalInstanceId; } + public string AzureBareMetalInstanceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)Property).AzureBareMetalInstanceId; } /// Specifies the AzureBareMetal instance SKU. [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum? HardwareProfileAzureBareMetalInstanceSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).HardwareProfileAzureBareMetalInstanceSize; } + public string HardwareProfileAzureBareMetalInstanceSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)Property).HardwareProfileAzureBareMetalInstanceSize; } /// Name of the hardware type (vendor and/or their product name) [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum? HardwareProfileHardwareType { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).HardwareProfileHardwareType; } + public string HardwareProfileHardwareType { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)Property).HardwareProfileHardwareType; } /// Hardware revision of an AzureBareMetal instance [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)] - public string HwRevision { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).HwRevision; } + public string HwRevision { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)Property).HwRevision; } /// /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)__trackedResource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResourceInternal)__trackedResource).Id; } /// The geo-location where the resource lives [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inherited)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceInternal)__trackedResource).Location = value ; } - - /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)__trackedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)__trackedResource).Id = value; } - - /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)__trackedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)__trackedResource).Name = value; } - - /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)__trackedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)__trackedResource).Type = value; } + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITrackedResourceInternal)__trackedResource).Location = value ?? null; } /// Internal Acessors for AzureBareMetalInstanceId - string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal.AzureBareMetalInstanceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).AzureBareMetalInstanceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).AzureBareMetalInstanceId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal.AzureBareMetalInstanceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)Property).AzureBareMetalInstanceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)Property).AzureBareMetalInstanceId = value; } /// Internal Acessors for HardwareProfile - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfile Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal.HardwareProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).HardwareProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).HardwareProfile = value; } + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IHardwareProfile Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal.HardwareProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)Property).HardwareProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)Property).HardwareProfile = value; } /// Internal Acessors for HardwareProfileAzureBareMetalInstanceSize - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum? Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal.HardwareProfileAzureBareMetalInstanceSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).HardwareProfileAzureBareMetalInstanceSize; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).HardwareProfileAzureBareMetalInstanceSize = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal.HardwareProfileAzureBareMetalInstanceSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)Property).HardwareProfileAzureBareMetalInstanceSize; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)Property).HardwareProfileAzureBareMetalInstanceSize = value; } /// Internal Acessors for HardwareProfileHardwareType - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum? Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal.HardwareProfileHardwareType { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).HardwareProfileHardwareType; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).HardwareProfileHardwareType = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal.HardwareProfileHardwareType { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)Property).HardwareProfileHardwareType; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)Property).HardwareProfileHardwareType = value; } /// Internal Acessors for HwRevision - string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal.HwRevision { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).HwRevision; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).HwRevision = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal.HwRevision { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)Property).HwRevision; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)Property).HwRevision = value; } /// Internal Acessors for NetworkProfile - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.INetworkProfile Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal.NetworkProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).NetworkProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).NetworkProfile = value; } + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.INetworkProfile Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal.NetworkProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)Property).NetworkProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)Property).NetworkProfile = value; } /// Internal Acessors for NetworkProfileCircuitId - string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal.NetworkProfileCircuitId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).NetworkProfileCircuitId; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).NetworkProfileCircuitId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal.NetworkProfileCircuitId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)Property).NetworkProfileCircuitId; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)Property).NetworkProfileCircuitId = value; } /// Internal Acessors for OSProfile - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfile Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal.OSProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).OSProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).OSProfile = value; } + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOSProfile Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal.OSProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)Property).OSProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)Property).OSProfile = value; } /// Internal Acessors for OSProfileOstype - string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal.OSProfileOstype { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).OSProfileOstype; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).OSProfileOstype = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal.OSProfileOstype { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)Property).OSProfileOstype; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)Property).OSProfileOstype = value; } /// Internal Acessors for OSProfileVersion - string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal.OSProfileVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).OSProfileVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).OSProfileVersion = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal.OSProfileVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)Property).OSProfileVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)Property).OSProfileVersion = value; } /// Internal Acessors for PowerState - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstancePowerStateEnum? Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal.PowerState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).PowerState; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).PowerState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal.PowerState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)Property).PowerState; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)Property).PowerState = value; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceProperties Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.AzureBareMetalInstanceProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceProperties Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.AzureBareMetalInstanceProperties()); set { {_property = value;} } } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalProvisioningStatesEnum? Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).ProvisioningState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)Property).ProvisioningState = value; } /// Internal Acessors for ProximityPlacementGroup - string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal.ProximityPlacementGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).ProximityPlacementGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).ProximityPlacementGroup = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal.ProximityPlacementGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)Property).ProximityPlacementGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)Property).ProximityPlacementGroup = value; } /// Internal Acessors for StorageProfile - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IStorageProfile Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal.StorageProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).StorageProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).StorageProfile = value; } + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IStorageProfile Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal.StorageProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)Property).StorageProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)Property).StorageProfile = value; } /// Internal Acessors for StorageProfileNfsIPAddress - string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal.StorageProfileNfsIPAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).StorageProfileNfsIPAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).StorageProfileNfsIPAddress = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal.StorageProfileNfsIPAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)Property).StorageProfileNfsIPAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)Property).StorageProfileNfsIPAddress = value; } /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemData Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.SystemData()); set { {_systemData = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.SystemData()); set { {_systemData = value;} } } + + /// Internal Acessors for SystemDataCreatedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal.SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ISystemDataInternal)SystemData).CreatedAt = value; } + + /// Internal Acessors for SystemDataCreatedBy + string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal.SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ISystemDataInternal)SystemData).CreatedBy = value; } + + /// Internal Acessors for SystemDataCreatedByType + string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal.SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ISystemDataInternal)SystemData).CreatedByType = value; } + + /// Internal Acessors for SystemDataLastModifiedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal.SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ISystemDataInternal)SystemData).LastModifiedAt = value; } + + /// Internal Acessors for SystemDataLastModifiedBy + string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal.SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ISystemDataInternal)SystemData).LastModifiedBy = value; } + + /// Internal Acessors for SystemDataLastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceInternal.SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ISystemDataInternal)SystemData).LastModifiedByType = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResourceInternal)__trackedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResourceInternal)__trackedResource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResourceInternal)__trackedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResourceInternal)__trackedResource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResourceInternal)__trackedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResourceInternal)__trackedResource).Type = value; } /// The name of the resource [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)__trackedResource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResourceInternal)__trackedResource).Name; } /// Specifies the circuit id for connecting to express route. [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)] - public string NetworkProfileCircuitId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).NetworkProfileCircuitId; } + public string NetworkProfileCircuitId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)Property).NetworkProfileCircuitId; } /// Specifies the network interfaces for the AzureBareMetal instance. [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IIPAddress[] NetworkProfileNetworkInterface { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).NetworkProfileNetworkInterface; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).NetworkProfileNetworkInterface = value ?? null /* arrayOf */; } + public System.Collections.Generic.List NetworkProfileNetworkInterface { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)Property).NetworkProfileNetworkInterface; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)Property).NetworkProfileNetworkInterface = value ?? null /* arrayOf */; } /// Specifies the host OS name of the AzureBareMetal instance. [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)] - public string OSProfileComputerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).OSProfileComputerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).OSProfileComputerName = value ?? null; } + public string OSProfileComputerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)Property).OSProfileComputerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)Property).OSProfileComputerName = value ?? null; } /// This property allows you to specify the type of the OS. [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)] - public string OSProfileOstype { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).OSProfileOstype; } + public string OSProfileOstype { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)Property).OSProfileOstype; } /// Specifies the SSH public key used to access the operating system. [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)] - public string OSProfileSshPublicKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).OSProfileSshPublicKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).OSProfileSshPublicKey = value ?? null; } + public string OSProfileSshPublicKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)Property).OSProfileSshPublicKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)Property).OSProfileSshPublicKey = value ?? null; } /// Specifies version of operating system. [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)] - public string OSProfileVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).OSProfileVersion; } + public string OSProfileVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)Property).OSProfileVersion; } /// /// ARM ID of another AzureBareMetalInstance that will share a network with this AzureBareMetalInstance /// [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)] - public string PartnerNodeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).PartnerNodeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).PartnerNodeId = value ?? null; } + public string PartnerNodeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)Property).PartnerNodeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)Property).PartnerNodeId = value ?? null; } /// Resource power state [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstancePowerStateEnum? PowerState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).PowerState; } + public string PowerState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)Property).PowerState; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceProperties _property; /// AzureBareMetal instance properties [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.AzureBareMetalInstanceProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.AzureBareMetalInstanceProperties()); set => this._property = value; } /// State of provisioning of the AzureBareMetalInstance [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalProvisioningStatesEnum? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).ProvisioningState; } + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)Property).ProvisioningState; } /// Resource proximity placement group [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)] - public string ProximityPlacementGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).ProximityPlacementGroup; } + public string ProximityPlacementGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)Property).ProximityPlacementGroup; } /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)] @@ -166,54 +183,54 @@ public partial class AzureBareMetalInstance : /// IP Address to connect to storage. [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)] - public string StorageProfileNfsIPAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).StorageProfileNfsIPAddress; } + public string StorageProfileNfsIPAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)Property).StorageProfileNfsIPAddress; } /// /// Specifies information about the operating system disk used by baremetal instance. /// [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisk[] StorageProfileOSDisk { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).StorageProfileOSDisk; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).StorageProfileOSDisk = value ?? null /* arrayOf */; } + public System.Collections.Generic.List StorageProfileOSDisk { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)Property).StorageProfileOSDisk; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)Property).StorageProfileOSDisk = value ?? null /* arrayOf */; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemData _systemData; + private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ISystemData _systemData; /// The system metadata relating to this resource. [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.SystemData()); } + internal Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.SystemData()); } /// The timestamp of resource creation (UTC). [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ISystemDataInternal)SystemData).CreatedAt; } /// The identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ISystemDataInternal)SystemData).CreatedBy; } /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.CreatedByType)""); } + public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ISystemDataInternal)SystemData).CreatedByType; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ISystemDataInternal)SystemData).LastModifiedAt; } /// The identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ISystemDataInternal)SystemData).LastModifiedBy; } /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.CreatedByType)""); } + public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ISystemDataInternal)SystemData).LastModifiedByType; } /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" /// [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)__trackedResource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResourceInternal)__trackedResource).Type; } /// Creates an new instance. public AzureBareMetalInstance() @@ -236,12 +253,15 @@ public AzureBareMetalInstance() /// AzureBareMetal instance info on Azure (ARM properties and AzureBareMetal properties) public partial interface IAzureBareMetalInstance : Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResource + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITrackedResource { /// Specifies the AzureBareMetal instance unique ID. [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Specifies the AzureBareMetal instance unique ID.", SerializedName = @"azureBareMetalInstanceId", PossibleTypes = new [] { typeof(string) })] @@ -250,22 +270,33 @@ public partial interface IAzureBareMetalInstance : [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Specifies the AzureBareMetal instance SKU.", SerializedName = @"azureBareMetalInstanceSize", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum) })] - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum? HardwareProfileAzureBareMetalInstanceSize { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PSArgumentCompleterAttribute("S72m", "S144m", "S72", "S144", "S192", "S192m", "S192xm", "S96", "S112", "S224", "S224m", "S224om", "S224oo", "S224oom", "S224ooo", "S384", "S384m", "S384xm", "S384xxm", "S448", "S448m", "S448om", "S448oo", "S448oom", "S448ooo", "S576m", "S576xm", "S672", "S672m", "S672om", "S672oo", "S672oom", "S672ooo", "S768", "S768m", "S768xm", "S896", "S896m", "S896om", "S896oo", "S896oom", "S896ooo", "S960m")] + string HardwareProfileAzureBareMetalInstanceSize { get; } /// Name of the hardware type (vendor and/or their product name) [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Name of the hardware type (vendor and/or their product name)", SerializedName = @"hardwareType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum) })] - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum? HardwareProfileHardwareType { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PSArgumentCompleterAttribute("Cisco_UCS", "HPE")] + string HardwareProfileHardwareType { get; } /// Hardware revision of an AzureBareMetal instance [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Hardware revision of an AzureBareMetal instance", SerializedName = @"hwRevision", PossibleTypes = new [] { typeof(string) })] @@ -274,6 +305,9 @@ public partial interface IAzureBareMetalInstance : [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Specifies the circuit id for connecting to express route.", SerializedName = @"circuitId", PossibleTypes = new [] { typeof(string) })] @@ -282,14 +316,20 @@ public partial interface IAzureBareMetalInstance : [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Specifies the network interfaces for the AzureBareMetal instance.", SerializedName = @"networkInterfaces", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IIPAddress) })] - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IIPAddress[] NetworkProfileNetworkInterface { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IIPAddress) })] + System.Collections.Generic.List NetworkProfileNetworkInterface { get; set; } /// Specifies the host OS name of the AzureBareMetal instance. [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Specifies the host OS name of the AzureBareMetal instance.", SerializedName = @"computerName", PossibleTypes = new [] { typeof(string) })] @@ -298,6 +338,9 @@ public partial interface IAzureBareMetalInstance : [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"This property allows you to specify the type of the OS.", SerializedName = @"osType", PossibleTypes = new [] { typeof(string) })] @@ -306,6 +349,9 @@ public partial interface IAzureBareMetalInstance : [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Specifies the SSH public key used to access the operating system.", SerializedName = @"sshPublicKey", PossibleTypes = new [] { typeof(string) })] @@ -314,6 +360,9 @@ public partial interface IAzureBareMetalInstance : [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Specifies version of operating system.", SerializedName = @"version", PossibleTypes = new [] { typeof(string) })] @@ -324,6 +373,9 @@ public partial interface IAzureBareMetalInstance : [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"ARM ID of another AzureBareMetalInstance that will share a network with this AzureBareMetalInstance", SerializedName = @"partnerNodeId", PossibleTypes = new [] { typeof(string) })] @@ -332,22 +384,33 @@ public partial interface IAzureBareMetalInstance : [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Resource power state", SerializedName = @"powerState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstancePowerStateEnum) })] - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstancePowerStateEnum? PowerState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PSArgumentCompleterAttribute("starting", "started", "stopping", "stopped", "restarting", "unknown")] + string PowerState { get; } /// State of provisioning of the AzureBareMetalInstance [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"State of provisioning of the AzureBareMetalInstance", SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalProvisioningStatesEnum) })] - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalProvisioningStatesEnum? ProvisioningState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PSArgumentCompleterAttribute("Accepted", "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating")] + string ProvisioningState { get; } /// Resource proximity placement group [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Resource proximity placement group", SerializedName = @"proximityPlacementGroup", PossibleTypes = new [] { typeof(string) })] @@ -356,6 +419,9 @@ public partial interface IAzureBareMetalInstance : [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"IP Address to connect to storage.", SerializedName = @"nfsIpAddress", PossibleTypes = new [] { typeof(string) })] @@ -366,82 +432,107 @@ public partial interface IAzureBareMetalInstance : [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Specifies information about the operating system disk used by baremetal instance.", SerializedName = @"osDisks", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisk) })] - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisk[] StorageProfileOSDisk { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDisk) })] + System.Collections.Generic.List StorageProfileOSDisk { get; set; } /// The timestamp of resource creation (UTC). [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.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.BareMetal.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.BareMetal.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.CreatedByType? SystemDataCreatedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataCreatedByType { get; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.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.BareMetal.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.BareMetal.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataLastModifiedByType { get; } } /// AzureBareMetal instance info on Azure (ARM properties and AzureBareMetal properties) internal partial interface IAzureBareMetalInstanceInternal : - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITrackedResourceInternal { /// Specifies the AzureBareMetal instance unique ID. string AzureBareMetalInstanceId { get; set; } /// Specifies the hardware settings for the AzureBareMetal instance. - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfile HardwareProfile { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IHardwareProfile HardwareProfile { get; set; } /// Specifies the AzureBareMetal instance SKU. - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum? HardwareProfileAzureBareMetalInstanceSize { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PSArgumentCompleterAttribute("S72m", "S144m", "S72", "S144", "S192", "S192m", "S192xm", "S96", "S112", "S224", "S224m", "S224om", "S224oo", "S224oom", "S224ooo", "S384", "S384m", "S384xm", "S384xxm", "S448", "S448m", "S448om", "S448oo", "S448oom", "S448ooo", "S576m", "S576xm", "S672", "S672m", "S672om", "S672oo", "S672oom", "S672ooo", "S768", "S768m", "S768xm", "S896", "S896m", "S896om", "S896oo", "S896oom", "S896ooo", "S960m")] + string HardwareProfileAzureBareMetalInstanceSize { get; set; } /// Name of the hardware type (vendor and/or their product name) - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum? HardwareProfileHardwareType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PSArgumentCompleterAttribute("Cisco_UCS", "HPE")] + string HardwareProfileHardwareType { get; set; } /// Hardware revision of an AzureBareMetal instance string HwRevision { get; set; } /// Specifies the network settings for the AzureBareMetal instance. - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.INetworkProfile NetworkProfile { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.INetworkProfile NetworkProfile { get; set; } /// Specifies the circuit id for connecting to express route. string NetworkProfileCircuitId { get; set; } /// Specifies the network interfaces for the AzureBareMetal instance. - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IIPAddress[] NetworkProfileNetworkInterface { get; set; } + System.Collections.Generic.List NetworkProfileNetworkInterface { get; set; } /// Specifies the operating system settings for the AzureBareMetal instance. - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfile OSProfile { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOSProfile OSProfile { get; set; } /// Specifies the host OS name of the AzureBareMetal instance. string OSProfileComputerName { get; set; } /// This property allows you to specify the type of the OS. @@ -455,35 +546,39 @@ internal partial interface IAzureBareMetalInstanceInternal : /// string PartnerNodeId { get; set; } /// Resource power state - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstancePowerStateEnum? PowerState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PSArgumentCompleterAttribute("starting", "started", "stopping", "stopped", "restarting", "unknown")] + string PowerState { get; set; } /// AzureBareMetal instance properties - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceProperties Property { get; set; } /// State of provisioning of the AzureBareMetalInstance - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalProvisioningStatesEnum? ProvisioningState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PSArgumentCompleterAttribute("Accepted", "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating")] + string ProvisioningState { get; set; } /// Resource proximity placement group string ProximityPlacementGroup { get; set; } /// Specifies the storage settings for the AzureBareMetal instance disks. - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IStorageProfile StorageProfile { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IStorageProfile StorageProfile { get; set; } /// IP Address to connect to storage. string StorageProfileNfsIPAddress { get; set; } /// /// Specifies information about the operating system disk used by baremetal instance. /// - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisk[] StorageProfileOSDisk { get; set; } + System.Collections.Generic.List StorageProfileOSDisk { get; set; } /// The system metadata relating to this resource. - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemData SystemData { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Support.CreatedByType? SystemDataCreatedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataLastModifiedByType { get; set; } } } \ No newline at end of file diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/AzureBareMetalInstance.json.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/AzureBareMetalInstance.json.cs similarity index 91% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/AzureBareMetalInstance.json.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/AzureBareMetalInstance.json.cs index 0b43d1b04c32..5ede5a0ae175 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/AzureBareMetalInstance.json.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/AzureBareMetalInstance.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.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions; @@ -67,20 +67,20 @@ internal AzureBareMetalInstance(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Run { return; } - __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.TrackedResource(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.AzureBareMetalInstanceProperties.FromJson(__jsonProperties) : Property;} - {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.SystemData.FromJson(__jsonSystemData) : SystemData;} + __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.TrackedResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.AzureBareMetalInstanceProperties.FromJson(__jsonProperties) : _property;} + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.SystemData.FromJson(__jsonSystemData) : _systemData;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstance. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstance. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstance. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstance. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstance FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstance FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json ? new AzureBareMetalInstance(json) : null; } @@ -106,7 +106,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode ToJson } __trackedResource?.ToJson(container, serializationMode); AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); } diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/AzureBareMetalInstanceProperties.PowerShell.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/AzureBareMetalInstanceProperties.PowerShell.cs new file mode 100644 index 000000000000..e74e969cd8c9 --- /dev/null +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/AzureBareMetalInstanceProperties.PowerShell.cs @@ -0,0 +1,316 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell; + + /// Describes the properties of an AzureBareMetal instance. + [System.ComponentModel.TypeConverter(typeof(AzureBareMetalInstancePropertiesTypeConverter))] + public partial class AzureBareMetalInstanceProperties + { + + /// + /// 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 AzureBareMetalInstanceProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("HardwareProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).HardwareProfile = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IHardwareProfile) content.GetValueForProperty("HardwareProfile",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).HardwareProfile, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.HardwareProfileTypeConverter.ConvertFrom); + } + if (content.Contains("StorageProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).StorageProfile = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IStorageProfile) content.GetValueForProperty("StorageProfile",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).StorageProfile, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.StorageProfileTypeConverter.ConvertFrom); + } + if (content.Contains("OSProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).OSProfile = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOSProfile) content.GetValueForProperty("OSProfile",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).OSProfile, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.OSProfileTypeConverter.ConvertFrom); + } + if (content.Contains("NetworkProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).NetworkProfile = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.INetworkProfile) content.GetValueForProperty("NetworkProfile",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).NetworkProfile, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.NetworkProfileTypeConverter.ConvertFrom); + } + if (content.Contains("AzureBareMetalInstanceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).AzureBareMetalInstanceId = (string) content.GetValueForProperty("AzureBareMetalInstanceId",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).AzureBareMetalInstanceId, global::System.Convert.ToString); + } + if (content.Contains("PowerState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).PowerState = (string) content.GetValueForProperty("PowerState",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).PowerState, global::System.Convert.ToString); + } + if (content.Contains("ProximityPlacementGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).ProximityPlacementGroup = (string) content.GetValueForProperty("ProximityPlacementGroup",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).ProximityPlacementGroup, global::System.Convert.ToString); + } + if (content.Contains("HwRevision")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).HwRevision = (string) content.GetValueForProperty("HwRevision",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).HwRevision, global::System.Convert.ToString); + } + if (content.Contains("PartnerNodeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).PartnerNodeId = (string) content.GetValueForProperty("PartnerNodeId",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).PartnerNodeId, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("StorageProfileOSDisk")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).StorageProfileOSDisk = (System.Collections.Generic.List) content.GetValueForProperty("StorageProfileOSDisk",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).StorageProfileOSDisk, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.DiskTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkProfileNetworkInterface")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).NetworkProfileNetworkInterface = (System.Collections.Generic.List) content.GetValueForProperty("NetworkProfileNetworkInterface",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).NetworkProfileNetworkInterface, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IPAddressTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkProfileCircuitId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).NetworkProfileCircuitId = (string) content.GetValueForProperty("NetworkProfileCircuitId",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).NetworkProfileCircuitId, global::System.Convert.ToString); + } + if (content.Contains("HardwareProfileHardwareType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).HardwareProfileHardwareType = (string) content.GetValueForProperty("HardwareProfileHardwareType",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).HardwareProfileHardwareType, global::System.Convert.ToString); + } + if (content.Contains("HardwareProfileAzureBareMetalInstanceSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).HardwareProfileAzureBareMetalInstanceSize = (string) content.GetValueForProperty("HardwareProfileAzureBareMetalInstanceSize",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).HardwareProfileAzureBareMetalInstanceSize, global::System.Convert.ToString); + } + if (content.Contains("StorageProfileNfsIPAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).StorageProfileNfsIPAddress = (string) content.GetValueForProperty("StorageProfileNfsIPAddress",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).StorageProfileNfsIPAddress, global::System.Convert.ToString); + } + if (content.Contains("OSProfileComputerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).OSProfileComputerName = (string) content.GetValueForProperty("OSProfileComputerName",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).OSProfileComputerName, global::System.Convert.ToString); + } + if (content.Contains("OSProfileOstype")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).OSProfileOstype = (string) content.GetValueForProperty("OSProfileOstype",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).OSProfileOstype, global::System.Convert.ToString); + } + if (content.Contains("OSProfileVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).OSProfileVersion = (string) content.GetValueForProperty("OSProfileVersion",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).OSProfileVersion, global::System.Convert.ToString); + } + if (content.Contains("OSProfileSshPublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).OSProfileSshPublicKey = (string) content.GetValueForProperty("OSProfileSshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).OSProfileSshPublicKey, 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 AzureBareMetalInstanceProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("HardwareProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).HardwareProfile = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IHardwareProfile) content.GetValueForProperty("HardwareProfile",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).HardwareProfile, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.HardwareProfileTypeConverter.ConvertFrom); + } + if (content.Contains("StorageProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).StorageProfile = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IStorageProfile) content.GetValueForProperty("StorageProfile",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).StorageProfile, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.StorageProfileTypeConverter.ConvertFrom); + } + if (content.Contains("OSProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).OSProfile = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOSProfile) content.GetValueForProperty("OSProfile",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).OSProfile, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.OSProfileTypeConverter.ConvertFrom); + } + if (content.Contains("NetworkProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).NetworkProfile = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.INetworkProfile) content.GetValueForProperty("NetworkProfile",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).NetworkProfile, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.NetworkProfileTypeConverter.ConvertFrom); + } + if (content.Contains("AzureBareMetalInstanceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).AzureBareMetalInstanceId = (string) content.GetValueForProperty("AzureBareMetalInstanceId",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).AzureBareMetalInstanceId, global::System.Convert.ToString); + } + if (content.Contains("PowerState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).PowerState = (string) content.GetValueForProperty("PowerState",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).PowerState, global::System.Convert.ToString); + } + if (content.Contains("ProximityPlacementGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).ProximityPlacementGroup = (string) content.GetValueForProperty("ProximityPlacementGroup",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).ProximityPlacementGroup, global::System.Convert.ToString); + } + if (content.Contains("HwRevision")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).HwRevision = (string) content.GetValueForProperty("HwRevision",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).HwRevision, global::System.Convert.ToString); + } + if (content.Contains("PartnerNodeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).PartnerNodeId = (string) content.GetValueForProperty("PartnerNodeId",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).PartnerNodeId, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("StorageProfileOSDisk")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).StorageProfileOSDisk = (System.Collections.Generic.List) content.GetValueForProperty("StorageProfileOSDisk",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).StorageProfileOSDisk, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.DiskTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkProfileNetworkInterface")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).NetworkProfileNetworkInterface = (System.Collections.Generic.List) content.GetValueForProperty("NetworkProfileNetworkInterface",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).NetworkProfileNetworkInterface, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IPAddressTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkProfileCircuitId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).NetworkProfileCircuitId = (string) content.GetValueForProperty("NetworkProfileCircuitId",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).NetworkProfileCircuitId, global::System.Convert.ToString); + } + if (content.Contains("HardwareProfileHardwareType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).HardwareProfileHardwareType = (string) content.GetValueForProperty("HardwareProfileHardwareType",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).HardwareProfileHardwareType, global::System.Convert.ToString); + } + if (content.Contains("HardwareProfileAzureBareMetalInstanceSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).HardwareProfileAzureBareMetalInstanceSize = (string) content.GetValueForProperty("HardwareProfileAzureBareMetalInstanceSize",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).HardwareProfileAzureBareMetalInstanceSize, global::System.Convert.ToString); + } + if (content.Contains("StorageProfileNfsIPAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).StorageProfileNfsIPAddress = (string) content.GetValueForProperty("StorageProfileNfsIPAddress",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).StorageProfileNfsIPAddress, global::System.Convert.ToString); + } + if (content.Contains("OSProfileComputerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).OSProfileComputerName = (string) content.GetValueForProperty("OSProfileComputerName",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).OSProfileComputerName, global::System.Convert.ToString); + } + if (content.Contains("OSProfileOstype")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).OSProfileOstype = (string) content.GetValueForProperty("OSProfileOstype",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).OSProfileOstype, global::System.Convert.ToString); + } + if (content.Contains("OSProfileVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).OSProfileVersion = (string) content.GetValueForProperty("OSProfileVersion",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).OSProfileVersion, global::System.Convert.ToString); + } + if (content.Contains("OSProfileSshPublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).OSProfileSshPublicKey = (string) content.GetValueForProperty("OSProfileSshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal)this).OSProfileSshPublicKey, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AzureBareMetalInstanceProperties(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.BareMetal.Models.IAzureBareMetalInstanceProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AzureBareMetalInstanceProperties(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.BareMetal.Models.IAzureBareMetalInstanceProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.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(); + } + } + /// Describes the properties of an AzureBareMetal instance. + [System.ComponentModel.TypeConverter(typeof(AzureBareMetalInstancePropertiesTypeConverter))] + public partial interface IAzureBareMetalInstanceProperties + + { + + } +} \ No newline at end of file diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/AzureBareMetalInstanceProperties.TypeConverter.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/AzureBareMetalInstanceProperties.TypeConverter.cs similarity index 96% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/AzureBareMetalInstanceProperties.TypeConverter.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/AzureBareMetalInstanceProperties.TypeConverter.cs index 7580a349ff02..a17d03cc8f51 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/AzureBareMetalInstanceProperties.TypeConverter.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/AzureBareMetalInstanceProperties.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.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Models.Api20210809.IAzureBareMetalInstanceProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/AzureBareMetalInstanceProperties.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/AzureBareMetalInstanceProperties.cs similarity index 59% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/AzureBareMetalInstanceProperties.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/AzureBareMetalInstanceProperties.cs index dbf23aaba7f1..9efcaf2390f3 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/AzureBareMetalInstanceProperties.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/AzureBareMetalInstanceProperties.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.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions; /// Describes the properties of an AzureBareMetal instance. public partial class AzureBareMetalInstanceProperties : - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceProperties, - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceProperties, + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal { /// Backing field for property. @@ -21,19 +21,19 @@ public partial class AzureBareMetalInstanceProperties : public string AzureBareMetalInstanceId { get => this._azureBareMetalInstanceId; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfile _hardwareProfile; + private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IHardwareProfile _hardwareProfile; /// Specifies the hardware settings for the AzureBareMetal instance. [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfile HardwareProfile { get => (this._hardwareProfile = this._hardwareProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.HardwareProfile()); set => this._hardwareProfile = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IHardwareProfile HardwareProfile { get => (this._hardwareProfile = this._hardwareProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.HardwareProfile()); set => this._hardwareProfile = value; } /// Specifies the AzureBareMetal instance SKU. [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum? HardwareProfileAzureBareMetalInstanceSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfileInternal)HardwareProfile).AzureBareMetalInstanceSize; } + public string HardwareProfileAzureBareMetalInstanceSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IHardwareProfileInternal)HardwareProfile).AzureBareMetalInstanceSize; } /// Name of the hardware type (vendor and/or their product name) [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum? HardwareProfileHardwareType { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfileInternal)HardwareProfile).HardwareType; } + public string HardwareProfileHardwareType { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IHardwareProfileInternal)HardwareProfile).HardwareType; } /// Backing field for property. private string _hwRevision; @@ -43,87 +43,87 @@ public partial class AzureBareMetalInstanceProperties : public string HwRevision { get => this._hwRevision; } /// Internal Acessors for AzureBareMetalInstanceId - string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal.AzureBareMetalInstanceId { get => this._azureBareMetalInstanceId; set { {_azureBareMetalInstanceId = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal.AzureBareMetalInstanceId { get => this._azureBareMetalInstanceId; set { {_azureBareMetalInstanceId = value;} } } /// Internal Acessors for HardwareProfile - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfile Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal.HardwareProfile { get => (this._hardwareProfile = this._hardwareProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.HardwareProfile()); set { {_hardwareProfile = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IHardwareProfile Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal.HardwareProfile { get => (this._hardwareProfile = this._hardwareProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.HardwareProfile()); set { {_hardwareProfile = value;} } } /// Internal Acessors for HardwareProfileAzureBareMetalInstanceSize - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum? Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal.HardwareProfileAzureBareMetalInstanceSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfileInternal)HardwareProfile).AzureBareMetalInstanceSize; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfileInternal)HardwareProfile).AzureBareMetalInstanceSize = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal.HardwareProfileAzureBareMetalInstanceSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IHardwareProfileInternal)HardwareProfile).AzureBareMetalInstanceSize; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IHardwareProfileInternal)HardwareProfile).AzureBareMetalInstanceSize = value; } /// Internal Acessors for HardwareProfileHardwareType - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum? Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal.HardwareProfileHardwareType { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfileInternal)HardwareProfile).HardwareType; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfileInternal)HardwareProfile).HardwareType = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal.HardwareProfileHardwareType { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IHardwareProfileInternal)HardwareProfile).HardwareType; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IHardwareProfileInternal)HardwareProfile).HardwareType = value; } /// Internal Acessors for HwRevision - string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal.HwRevision { get => this._hwRevision; set { {_hwRevision = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal.HwRevision { get => this._hwRevision; set { {_hwRevision = value;} } } /// Internal Acessors for NetworkProfile - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.INetworkProfile Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal.NetworkProfile { get => (this._networkProfile = this._networkProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.NetworkProfile()); set { {_networkProfile = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.INetworkProfile Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal.NetworkProfile { get => (this._networkProfile = this._networkProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.NetworkProfile()); set { {_networkProfile = value;} } } /// Internal Acessors for NetworkProfileCircuitId - string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal.NetworkProfileCircuitId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.INetworkProfileInternal)NetworkProfile).CircuitId; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.INetworkProfileInternal)NetworkProfile).CircuitId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal.NetworkProfileCircuitId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.INetworkProfileInternal)NetworkProfile).CircuitId; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.INetworkProfileInternal)NetworkProfile).CircuitId = value; } /// Internal Acessors for OSProfile - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfile Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal.OSProfile { get => (this._oSProfile = this._oSProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.OSProfile()); set { {_oSProfile = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOSProfile Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal.OSProfile { get => (this._oSProfile = this._oSProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.OSProfile()); set { {_oSProfile = value;} } } /// Internal Acessors for OSProfileOstype - string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal.OSProfileOstype { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfileInternal)OSProfile).OSType; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfileInternal)OSProfile).OSType = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal.OSProfileOstype { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOSProfileInternal)OSProfile).OSType; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOSProfileInternal)OSProfile).OSType = value; } /// Internal Acessors for OSProfileVersion - string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal.OSProfileVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfileInternal)OSProfile).Version; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfileInternal)OSProfile).Version = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal.OSProfileVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOSProfileInternal)OSProfile).Version; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOSProfileInternal)OSProfile).Version = value; } /// Internal Acessors for PowerState - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstancePowerStateEnum? Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal.PowerState { get => this._powerState; set { {_powerState = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal.PowerState { get => this._powerState; set { {_powerState = value;} } } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalProvisioningStatesEnum? Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } /// Internal Acessors for ProximityPlacementGroup - string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal.ProximityPlacementGroup { get => this._proximityPlacementGroup; set { {_proximityPlacementGroup = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal.ProximityPlacementGroup { get => this._proximityPlacementGroup; set { {_proximityPlacementGroup = value;} } } /// Internal Acessors for StorageProfile - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IStorageProfile Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal.StorageProfile { get => (this._storageProfile = this._storageProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.StorageProfile()); set { {_storageProfile = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IStorageProfile Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal.StorageProfile { get => (this._storageProfile = this._storageProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.StorageProfile()); set { {_storageProfile = value;} } } /// Internal Acessors for StorageProfileNfsIPAddress - string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal.StorageProfileNfsIPAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IStorageProfileInternal)StorageProfile).NfsIPAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IStorageProfileInternal)StorageProfile).NfsIPAddress = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancePropertiesInternal.StorageProfileNfsIPAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IStorageProfileInternal)StorageProfile).NfsIPAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IStorageProfileInternal)StorageProfile).NfsIPAddress = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.INetworkProfile _networkProfile; + private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.INetworkProfile _networkProfile; /// Specifies the network settings for the AzureBareMetal instance. [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.INetworkProfile NetworkProfile { get => (this._networkProfile = this._networkProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.NetworkProfile()); set => this._networkProfile = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.INetworkProfile NetworkProfile { get => (this._networkProfile = this._networkProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.NetworkProfile()); set => this._networkProfile = value; } /// Specifies the circuit id for connecting to express route. [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)] - public string NetworkProfileCircuitId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.INetworkProfileInternal)NetworkProfile).CircuitId; } + public string NetworkProfileCircuitId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.INetworkProfileInternal)NetworkProfile).CircuitId; } /// Specifies the network interfaces for the AzureBareMetal instance. [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IIPAddress[] NetworkProfileNetworkInterface { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.INetworkProfileInternal)NetworkProfile).NetworkInterface; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.INetworkProfileInternal)NetworkProfile).NetworkInterface = value ?? null /* arrayOf */; } + public System.Collections.Generic.List NetworkProfileNetworkInterface { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.INetworkProfileInternal)NetworkProfile).NetworkInterface; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.INetworkProfileInternal)NetworkProfile).NetworkInterface = value ?? null /* arrayOf */; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfile _oSProfile; + private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOSProfile _oSProfile; /// Specifies the operating system settings for the AzureBareMetal instance. [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfile OSProfile { get => (this._oSProfile = this._oSProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.OSProfile()); set => this._oSProfile = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOSProfile OSProfile { get => (this._oSProfile = this._oSProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.OSProfile()); set => this._oSProfile = value; } /// Specifies the host OS name of the AzureBareMetal instance. [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)] - public string OSProfileComputerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfileInternal)OSProfile).ComputerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfileInternal)OSProfile).ComputerName = value ?? null; } + public string OSProfileComputerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOSProfileInternal)OSProfile).ComputerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOSProfileInternal)OSProfile).ComputerName = value ?? null; } /// This property allows you to specify the type of the OS. [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)] - public string OSProfileOstype { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfileInternal)OSProfile).OSType; } + public string OSProfileOstype { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOSProfileInternal)OSProfile).OSType; } /// Specifies the SSH public key used to access the operating system. [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)] - public string OSProfileSshPublicKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfileInternal)OSProfile).SshPublicKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfileInternal)OSProfile).SshPublicKey = value ?? null; } + public string OSProfileSshPublicKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOSProfileInternal)OSProfile).SshPublicKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOSProfileInternal)OSProfile).SshPublicKey = value ?? null; } /// Specifies version of operating system. [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)] - public string OSProfileVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfileInternal)OSProfile).Version; } + public string OSProfileVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOSProfileInternal)OSProfile).Version; } /// Backing field for property. private string _partnerNodeId; @@ -135,18 +135,18 @@ public partial class AzureBareMetalInstanceProperties : public string PartnerNodeId { get => this._partnerNodeId; set => this._partnerNodeId = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstancePowerStateEnum? _powerState; + private string _powerState; /// Resource power state [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstancePowerStateEnum? PowerState { get => this._powerState; } + public string PowerState { get => this._powerState; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalProvisioningStatesEnum? _provisioningState; + private string _provisioningState; /// State of provisioning of the AzureBareMetalInstance [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalProvisioningStatesEnum? ProvisioningState { get => this._provisioningState; } + public string ProvisioningState { get => this._provisioningState; } /// Backing field for property. private string _proximityPlacementGroup; @@ -156,21 +156,21 @@ public partial class AzureBareMetalInstanceProperties : public string ProximityPlacementGroup { get => this._proximityPlacementGroup; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IStorageProfile _storageProfile; + private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IStorageProfile _storageProfile; /// Specifies the storage settings for the AzureBareMetal instance disks. [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IStorageProfile StorageProfile { get => (this._storageProfile = this._storageProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.StorageProfile()); set => this._storageProfile = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IStorageProfile StorageProfile { get => (this._storageProfile = this._storageProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.StorageProfile()); set => this._storageProfile = value; } /// IP Address to connect to storage. [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)] - public string StorageProfileNfsIPAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IStorageProfileInternal)StorageProfile).NfsIPAddress; } + public string StorageProfileNfsIPAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IStorageProfileInternal)StorageProfile).NfsIPAddress; } /// /// Specifies information about the operating system disk used by baremetal instance. /// [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisk[] StorageProfileOSDisk { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IStorageProfileInternal)StorageProfile).OSDisk; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IStorageProfileInternal)StorageProfile).OSDisk = value ?? null /* arrayOf */; } + public System.Collections.Generic.List StorageProfileOSDisk { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IStorageProfileInternal)StorageProfile).OSDisk; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IStorageProfileInternal)StorageProfile).OSDisk = value ?? null /* arrayOf */; } /// Creates an new instance. public AzureBareMetalInstanceProperties() @@ -186,6 +186,9 @@ public partial interface IAzureBareMetalInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Specifies the AzureBareMetal instance unique ID.", SerializedName = @"azureBareMetalInstanceId", PossibleTypes = new [] { typeof(string) })] @@ -194,22 +197,33 @@ public partial interface IAzureBareMetalInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Specifies the AzureBareMetal instance SKU.", SerializedName = @"azureBareMetalInstanceSize", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum) })] - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum? HardwareProfileAzureBareMetalInstanceSize { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PSArgumentCompleterAttribute("S72m", "S144m", "S72", "S144", "S192", "S192m", "S192xm", "S96", "S112", "S224", "S224m", "S224om", "S224oo", "S224oom", "S224ooo", "S384", "S384m", "S384xm", "S384xxm", "S448", "S448m", "S448om", "S448oo", "S448oom", "S448ooo", "S576m", "S576xm", "S672", "S672m", "S672om", "S672oo", "S672oom", "S672ooo", "S768", "S768m", "S768xm", "S896", "S896m", "S896om", "S896oo", "S896oom", "S896ooo", "S960m")] + string HardwareProfileAzureBareMetalInstanceSize { get; } /// Name of the hardware type (vendor and/or their product name) [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Name of the hardware type (vendor and/or their product name)", SerializedName = @"hardwareType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum) })] - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum? HardwareProfileHardwareType { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PSArgumentCompleterAttribute("Cisco_UCS", "HPE")] + string HardwareProfileHardwareType { get; } /// Hardware revision of an AzureBareMetal instance [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Hardware revision of an AzureBareMetal instance", SerializedName = @"hwRevision", PossibleTypes = new [] { typeof(string) })] @@ -218,6 +232,9 @@ public partial interface IAzureBareMetalInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Specifies the circuit id for connecting to express route.", SerializedName = @"circuitId", PossibleTypes = new [] { typeof(string) })] @@ -226,14 +243,20 @@ public partial interface IAzureBareMetalInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Specifies the network interfaces for the AzureBareMetal instance.", SerializedName = @"networkInterfaces", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IIPAddress) })] - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IIPAddress[] NetworkProfileNetworkInterface { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IIPAddress) })] + System.Collections.Generic.List NetworkProfileNetworkInterface { get; set; } /// Specifies the host OS name of the AzureBareMetal instance. [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Specifies the host OS name of the AzureBareMetal instance.", SerializedName = @"computerName", PossibleTypes = new [] { typeof(string) })] @@ -242,6 +265,9 @@ public partial interface IAzureBareMetalInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"This property allows you to specify the type of the OS.", SerializedName = @"osType", PossibleTypes = new [] { typeof(string) })] @@ -250,6 +276,9 @@ public partial interface IAzureBareMetalInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Specifies the SSH public key used to access the operating system.", SerializedName = @"sshPublicKey", PossibleTypes = new [] { typeof(string) })] @@ -258,6 +287,9 @@ public partial interface IAzureBareMetalInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Specifies version of operating system.", SerializedName = @"version", PossibleTypes = new [] { typeof(string) })] @@ -268,6 +300,9 @@ public partial interface IAzureBareMetalInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"ARM ID of another AzureBareMetalInstance that will share a network with this AzureBareMetalInstance", SerializedName = @"partnerNodeId", PossibleTypes = new [] { typeof(string) })] @@ -276,22 +311,33 @@ public partial interface IAzureBareMetalInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Resource power state", SerializedName = @"powerState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstancePowerStateEnum) })] - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstancePowerStateEnum? PowerState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PSArgumentCompleterAttribute("starting", "started", "stopping", "stopped", "restarting", "unknown")] + string PowerState { get; } /// State of provisioning of the AzureBareMetalInstance [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"State of provisioning of the AzureBareMetalInstance", SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalProvisioningStatesEnum) })] - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalProvisioningStatesEnum? ProvisioningState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PSArgumentCompleterAttribute("Accepted", "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating")] + string ProvisioningState { get; } /// Resource proximity placement group [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Resource proximity placement group", SerializedName = @"proximityPlacementGroup", PossibleTypes = new [] { typeof(string) })] @@ -300,6 +346,9 @@ public partial interface IAzureBareMetalInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"IP Address to connect to storage.", SerializedName = @"nfsIpAddress", PossibleTypes = new [] { typeof(string) })] @@ -310,10 +359,13 @@ public partial interface IAzureBareMetalInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Specifies information about the operating system disk used by baremetal instance.", SerializedName = @"osDisks", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisk) })] - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisk[] StorageProfileOSDisk { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDisk) })] + System.Collections.Generic.List StorageProfileOSDisk { get; set; } } /// Describes the properties of an AzureBareMetal instance. @@ -323,21 +375,23 @@ internal partial interface IAzureBareMetalInstancePropertiesInternal /// Specifies the AzureBareMetal instance unique ID. string AzureBareMetalInstanceId { get; set; } /// Specifies the hardware settings for the AzureBareMetal instance. - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfile HardwareProfile { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IHardwareProfile HardwareProfile { get; set; } /// Specifies the AzureBareMetal instance SKU. - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum? HardwareProfileAzureBareMetalInstanceSize { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PSArgumentCompleterAttribute("S72m", "S144m", "S72", "S144", "S192", "S192m", "S192xm", "S96", "S112", "S224", "S224m", "S224om", "S224oo", "S224oom", "S224ooo", "S384", "S384m", "S384xm", "S384xxm", "S448", "S448m", "S448om", "S448oo", "S448oom", "S448ooo", "S576m", "S576xm", "S672", "S672m", "S672om", "S672oo", "S672oom", "S672ooo", "S768", "S768m", "S768xm", "S896", "S896m", "S896om", "S896oo", "S896oom", "S896ooo", "S960m")] + string HardwareProfileAzureBareMetalInstanceSize { get; set; } /// Name of the hardware type (vendor and/or their product name) - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum? HardwareProfileHardwareType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PSArgumentCompleterAttribute("Cisco_UCS", "HPE")] + string HardwareProfileHardwareType { get; set; } /// Hardware revision of an AzureBareMetal instance string HwRevision { get; set; } /// Specifies the network settings for the AzureBareMetal instance. - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.INetworkProfile NetworkProfile { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.INetworkProfile NetworkProfile { get; set; } /// Specifies the circuit id for connecting to express route. string NetworkProfileCircuitId { get; set; } /// Specifies the network interfaces for the AzureBareMetal instance. - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IIPAddress[] NetworkProfileNetworkInterface { get; set; } + System.Collections.Generic.List NetworkProfileNetworkInterface { get; set; } /// Specifies the operating system settings for the AzureBareMetal instance. - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfile OSProfile { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOSProfile OSProfile { get; set; } /// Specifies the host OS name of the AzureBareMetal instance. string OSProfileComputerName { get; set; } /// This property allows you to specify the type of the OS. @@ -351,19 +405,21 @@ internal partial interface IAzureBareMetalInstancePropertiesInternal /// string PartnerNodeId { get; set; } /// Resource power state - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstancePowerStateEnum? PowerState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PSArgumentCompleterAttribute("starting", "started", "stopping", "stopped", "restarting", "unknown")] + string PowerState { get; set; } /// State of provisioning of the AzureBareMetalInstance - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalProvisioningStatesEnum? ProvisioningState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PSArgumentCompleterAttribute("Accepted", "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating")] + string ProvisioningState { get; set; } /// Resource proximity placement group string ProximityPlacementGroup { get; set; } /// Specifies the storage settings for the AzureBareMetal instance disks. - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IStorageProfile StorageProfile { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IStorageProfile StorageProfile { get; set; } /// IP Address to connect to storage. string StorageProfileNfsIPAddress { get; set; } /// /// Specifies information about the operating system disk used by baremetal instance. /// - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisk[] StorageProfileOSDisk { get; set; } + System.Collections.Generic.List StorageProfileOSDisk { get; set; } } } \ No newline at end of file diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/AzureBareMetalInstanceProperties.json.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/AzureBareMetalInstanceProperties.json.cs similarity index 88% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/AzureBareMetalInstanceProperties.json.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/AzureBareMetalInstanceProperties.json.cs index b8c642aa85a5..7997ee9fc8b2 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/AzureBareMetalInstanceProperties.json.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/AzureBareMetalInstanceProperties.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.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions; @@ -65,27 +65,27 @@ internal AzureBareMetalInstanceProperties(Microsoft.Azure.PowerShell.Cmdlets.Bar { return; } - {_hardwareProfile = If( json?.PropertyT("hardwareProfile"), out var __jsonHardwareProfile) ? Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.HardwareProfile.FromJson(__jsonHardwareProfile) : HardwareProfile;} - {_storageProfile = If( json?.PropertyT("storageProfile"), out var __jsonStorageProfile) ? Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.StorageProfile.FromJson(__jsonStorageProfile) : StorageProfile;} - {_oSProfile = If( json?.PropertyT("osProfile"), out var __jsonOSProfile) ? Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.OSProfile.FromJson(__jsonOSProfile) : OSProfile;} - {_networkProfile = If( json?.PropertyT("networkProfile"), out var __jsonNetworkProfile) ? Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.NetworkProfile.FromJson(__jsonNetworkProfile) : NetworkProfile;} - {_azureBareMetalInstanceId = If( json?.PropertyT("azureBareMetalInstanceId"), out var __jsonAzureBareMetalInstanceId) ? (string)__jsonAzureBareMetalInstanceId : (string)AzureBareMetalInstanceId;} - {_powerState = If( json?.PropertyT("powerState"), out var __jsonPowerState) ? (string)__jsonPowerState : (string)PowerState;} - {_proximityPlacementGroup = If( json?.PropertyT("proximityPlacementGroup"), out var __jsonProximityPlacementGroup) ? (string)__jsonProximityPlacementGroup : (string)ProximityPlacementGroup;} - {_hwRevision = If( json?.PropertyT("hwRevision"), out var __jsonHwRevision) ? (string)__jsonHwRevision : (string)HwRevision;} - {_partnerNodeId = If( json?.PropertyT("partnerNodeId"), out var __jsonPartnerNodeId) ? (string)__jsonPartnerNodeId : (string)PartnerNodeId;} - {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} + {_hardwareProfile = If( json?.PropertyT("hardwareProfile"), out var __jsonHardwareProfile) ? Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.HardwareProfile.FromJson(__jsonHardwareProfile) : _hardwareProfile;} + {_storageProfile = If( json?.PropertyT("storageProfile"), out var __jsonStorageProfile) ? Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.StorageProfile.FromJson(__jsonStorageProfile) : _storageProfile;} + {_oSProfile = If( json?.PropertyT("osProfile"), out var __jsonOSProfile) ? Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.OSProfile.FromJson(__jsonOSProfile) : _oSProfile;} + {_networkProfile = If( json?.PropertyT("networkProfile"), out var __jsonNetworkProfile) ? Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.NetworkProfile.FromJson(__jsonNetworkProfile) : _networkProfile;} + {_azureBareMetalInstanceId = If( json?.PropertyT("azureBareMetalInstanceId"), out var __jsonAzureBareMetalInstanceId) ? (string)__jsonAzureBareMetalInstanceId : (string)_azureBareMetalInstanceId;} + {_powerState = If( json?.PropertyT("powerState"), out var __jsonPowerState) ? (string)__jsonPowerState : (string)_powerState;} + {_proximityPlacementGroup = If( json?.PropertyT("proximityPlacementGroup"), out var __jsonProximityPlacementGroup) ? (string)__jsonProximityPlacementGroup : (string)_proximityPlacementGroup;} + {_hwRevision = If( json?.PropertyT("hwRevision"), out var __jsonHwRevision) ? (string)__jsonHwRevision : (string)_hwRevision;} + {_partnerNodeId = If( json?.PropertyT("partnerNodeId"), out var __jsonPartnerNodeId) ? (string)__jsonPartnerNodeId : (string)_partnerNodeId;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstanceProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json ? new AzureBareMetalInstanceProperties(json) : null; } @@ -113,24 +113,24 @@ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode ToJson AddIf( null != this._storageProfile ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) this._storageProfile.ToJson(null,serializationMode) : null, "storageProfile" ,container.Add ); AddIf( null != this._oSProfile ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) this._oSProfile.ToJson(null,serializationMode) : null, "osProfile" ,container.Add ); AddIf( null != this._networkProfile ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) this._networkProfile.ToJson(null,serializationMode) : null, "networkProfile" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._azureBareMetalInstanceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._azureBareMetalInstanceId.ToString()) : null, "azureBareMetalInstanceId" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._powerState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._powerState.ToString()) : null, "powerState" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._proximityPlacementGroup)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._proximityPlacementGroup.ToString()) : null, "proximityPlacementGroup" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._hwRevision)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._hwRevision.ToString()) : null, "hwRevision" ,container.Add ); } AddIf( null != (((object)this._partnerNodeId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._partnerNodeId.ToString()) : null, "partnerNodeId" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); } diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/AzureBareMetalInstancesListResult.PowerShell.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/AzureBareMetalInstancesListResult.PowerShell.cs similarity index 75% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/AzureBareMetalInstancesListResult.PowerShell.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/AzureBareMetalInstancesListResult.PowerShell.cs index 1c423e1c8093..e76ed9c5b00d 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/AzureBareMetalInstancesListResult.PowerShell.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/AzureBareMetalInstancesListResult.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.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class AzureBareMetalInstancesListResult 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 AzureBareMetalInstancesListResult(global::System.Collections.IDictionar // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancesListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstance[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancesListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.AzureBareMetalInstanceTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancesListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancesListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.AzureBareMetalInstanceTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancesListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancesListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancesListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancesListResultInternal)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 AzureBareMetalInstancesListResult(global::System.Management.Automation. // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancesListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstance[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancesListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.AzureBareMetalInstanceTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancesListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancesListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.AzureBareMetalInstanceTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancesListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancesListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancesListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancesListResultInternal)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.BareMetal.Models.Api20210809.IAzureBareMetalInstancesListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancesListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AzureBareMetalInstancesListResult(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.BareMetal.Models.Api20210809.IAzureBareMetalInstancesListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancesListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AzureBareMetalInstancesListResult(content); } @@ -147,7 +145,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IA /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancesListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancesListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/AzureBareMetalInstancesListResult.TypeConverter.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/AzureBareMetalInstancesListResult.TypeConverter.cs similarity index 96% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/AzureBareMetalInstancesListResult.TypeConverter.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/AzureBareMetalInstancesListResult.TypeConverter.cs index 5d452804465e..96f1b877ff71 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/AzureBareMetalInstancesListResult.TypeConverter.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/AzureBareMetalInstancesListResult.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.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Models.Api20210809.IAzureBareMetalInstancesListResult ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancesListResult ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancesListResult).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancesListResult).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/AzureBareMetalInstancesListResult.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/AzureBareMetalInstancesListResult.cs similarity index 72% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/AzureBareMetalInstancesListResult.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/AzureBareMetalInstancesListResult.cs index 75327536ac70..e20feccbdc0e 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/AzureBareMetalInstancesListResult.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/AzureBareMetalInstancesListResult.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.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions; /// The response from the List AzureBareMetal Instances operation. public partial class AzureBareMetalInstancesListResult : - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancesListResult, - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancesListResultInternal + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancesListResult, + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancesListResultInternal { /// Backing field for property. @@ -21,11 +21,11 @@ public partial class AzureBareMetalInstancesListResult : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstance[] _value; + private System.Collections.Generic.List _value; /// The list of Azure BareMetal instances. [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstance[] 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 AzureBareMetalInstancesListResult() @@ -41,6 +41,9 @@ public partial interface IAzureBareMetalInstancesListResult : [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The URL to get the next set of AzureBareMetal instances.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -49,10 +52,13 @@ public partial interface IAzureBareMetalInstancesListResult : [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of Azure BareMetal instances.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstance) })] - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstance[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstance) })] + System.Collections.Generic.List Value { get; set; } } /// The response from the List AzureBareMetal Instances operation. @@ -62,7 +68,7 @@ internal partial interface IAzureBareMetalInstancesListResultInternal /// The URL to get the next set of AzureBareMetal instances. string NextLink { get; set; } /// The list of Azure BareMetal instances. - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstance[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/AzureBareMetalInstancesListResult.json.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/AzureBareMetalInstancesListResult.json.cs similarity index 89% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/AzureBareMetalInstancesListResult.json.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/AzureBareMetalInstancesListResult.json.cs index 35a503e87dc7..f84f61db946d 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/AzureBareMetalInstancesListResult.json.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/AzureBareMetalInstancesListResult.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.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions; @@ -65,19 +65,19 @@ internal AzureBareMetalInstancesListResult(Microsoft.Azure.PowerShell.Cmdlets.Ba { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Models.Api20210809.IAzureBareMetalInstance) (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.AzureBareMetalInstance.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.BareMetal.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.BareMetal.Models.IAzureBareMetalInstance) (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.AzureBareMetalInstance.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.BareMetal.Models.Api20210809.IAzureBareMetalInstancesListResult. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancesListResult. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancesListResult. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancesListResult. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancesListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancesListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json ? new AzureBareMetalInstancesListResult(json) : null; } diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/BareMetalIdentity.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/BareMetalIdentity.cs index 1b9142fb620c..6ad328fb194a 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/BareMetalIdentity.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/BareMetalIdentity.cs @@ -53,6 +53,9 @@ public partial interface IBareMetalIdentity : [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Name of the Azure BareMetal on Azure instance.", SerializedName = @"azureBareMetalInstanceName", PossibleTypes = new [] { typeof(string) })] @@ -61,6 +64,9 @@ public partial interface IBareMetalIdentity : [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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 IBareMetalIdentity : [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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 IBareMetalIdentity : [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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/BareMetal/BareMetal.Autorest/generated/api/Models/BareMetalIdentity.json.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/BareMetalIdentity.json.cs index c77618cc4a79..66ea4cd1b678 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/BareMetalIdentity.json.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/BareMetalIdentity.json.cs @@ -64,10 +64,10 @@ internal BareMetalIdentity(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime. { 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;} - {_azureBareMetalInstanceName = If( json?.PropertyT("azureBareMetalInstanceName"), out var __jsonAzureBareMetalInstanceName) ? (string)__jsonAzureBareMetalInstanceName : (string)AzureBareMetalInstanceName;} - {_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;} + {_azureBareMetalInstanceName = If( json?.PropertyT("azureBareMetalInstanceName"), out var __jsonAzureBareMetalInstanceName) ? (string)__jsonAzureBareMetalInstanceName : (string)_azureBareMetalInstanceName;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} AfterFromJson(json); } diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Disk.PowerShell.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Disk.PowerShell.cs similarity index 79% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Disk.PowerShell.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/Disk.PowerShell.cs index 5d56b528af72..21e7c8de40f6 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Disk.PowerShell.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Disk.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.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell; @@ -63,33 +63,33 @@ public partial class Disk 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.BareMetal.Models.Api20210809.IDisk DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDisk DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new Disk(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.BareMetal.Models.Api20210809.IDisk DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDisk DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new Disk(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -104,21 +104,21 @@ internal Disk(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDiskInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDiskInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDiskInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDiskInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("SizeGb")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDiskInternal)this).SizeGb = (int?) content.GetValueForProperty("SizeGb",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDiskInternal)this).SizeGb, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDiskInternal)this).SizeGb = (int?) content.GetValueForProperty("SizeGb",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDiskInternal)this).SizeGb, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("Lun")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDiskInternal)this).Lun = (int?) content.GetValueForProperty("Lun",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDiskInternal)this).Lun, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDiskInternal)this).Lun = (int?) content.GetValueForProperty("Lun",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDiskInternal)this).Lun, (__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. @@ -133,15 +133,15 @@ internal Disk(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDiskInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDiskInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDiskInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDiskInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("SizeGb")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDiskInternal)this).SizeGb = (int?) content.GetValueForProperty("SizeGb",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDiskInternal)this).SizeGb, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDiskInternal)this).SizeGb = (int?) content.GetValueForProperty("SizeGb",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDiskInternal)this).SizeGb, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("Lun")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDiskInternal)this).Lun = (int?) content.GetValueForProperty("Lun",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDiskInternal)this).Lun, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDiskInternal)this).Lun = (int?) content.GetValueForProperty("Lun",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDiskInternal)this).Lun, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } AfterDeserializePSObject(content); } @@ -151,7 +151,7 @@ internal Disk(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.BareMetal.Models.Api20210809.IDisk FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDisk FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Disk.TypeConverter.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Disk.TypeConverter.cs similarity index 97% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Disk.TypeConverter.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/Disk.TypeConverter.cs index 3fba717843d8..f68ba744f887 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Disk.TypeConverter.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Disk.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.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Models.Api20210809.IDisk ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDisk ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisk).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDisk).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Disk.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Disk.cs similarity index 90% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Disk.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/Disk.cs index 30154728b162..6fe647ba8d3b 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Disk.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Disk.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.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions; /// Specifies the disk information fo the AzureBareMetal instance public partial class Disk : - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisk, - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDiskInternal + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDisk, + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDiskInternal { /// Backing field for property. @@ -24,7 +24,7 @@ public partial class Disk : public int? Lun { get => this._lun; } /// Internal Acessors for Lun - int? Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDiskInternal.Lun { get => this._lun; set { {_lun = value;} } } + int? Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDiskInternal.Lun { get => this._lun; set { {_lun = value;} } } /// Backing field for property. private string _name; @@ -57,6 +57,9 @@ public partial interface IDisk : [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM.", SerializedName = @"lun", PossibleTypes = new [] { typeof(int) })] @@ -65,6 +68,9 @@ public partial interface IDisk : [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The disk name.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -73,6 +79,9 @@ public partial interface IDisk : [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Specifies the size of an empty data disk in gigabytes.", SerializedName = @"diskSizeGB", PossibleTypes = new [] { typeof(int) })] diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Disk.json.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Disk.json.cs similarity index 92% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Disk.json.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/Disk.json.cs index e9202994fcc2..90aa156b8522 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Disk.json.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Disk.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.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions; @@ -65,20 +65,18 @@ internal Disk(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObje { return; } - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_sizeGb = If( json?.PropertyT("diskSizeGB"), out var __jsonDiskSizeGb) ? (int?)__jsonDiskSizeGb : SizeGb;} - {_lun = If( json?.PropertyT("lun"), out var __jsonLun) ? (int?)__jsonLun : Lun;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_sizeGb = If( json?.PropertyT("diskSizeGB"), out var __jsonDiskSizeGb) ? (int?)__jsonDiskSizeGb : _sizeGb;} + {_lun = If( json?.PropertyT("lun"), out var __jsonLun) ? (int?)__jsonLun : _lun;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisk. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDisk. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisk. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisk FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDisk. + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDisk FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json ? new Disk(json) : null; } @@ -104,7 +102,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode ToJson } AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); AddIf( null != this._sizeGb ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNumber((int)this._sizeGb) : null, "diskSizeGB" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._lun ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNumber((int)this._lun) : null, "lun" ,container.Add ); } diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Display.PowerShell.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Display.PowerShell.cs similarity index 76% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Display.PowerShell.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/Display.PowerShell.cs index e694917be14b..e88aa6e032fa 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Display.PowerShell.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Display.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.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell; @@ -63,33 +63,33 @@ public partial class Display 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.BareMetal.Models.Api20210809.IDisplay DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDisplay DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new Display(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.BareMetal.Models.Api20210809.IDisplay DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDisplay DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new Display(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -104,25 +104,25 @@ internal Display(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Provider")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal)this).Provider, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDisplayInternal)this).Provider, global::System.Convert.ToString); } if (content.Contains("Resource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal)this).Resource, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDisplayInternal)this).Resource, global::System.Convert.ToString); } if (content.Contains("Operation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal)this).Operation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDisplayInternal)this).Operation, global::System.Convert.ToString); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDisplayInternal)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. @@ -137,19 +137,19 @@ internal Display(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Provider")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal)this).Provider, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDisplayInternal)this).Provider, global::System.Convert.ToString); } if (content.Contains("Resource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal)this).Resource, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDisplayInternal)this).Resource, global::System.Convert.ToString); } if (content.Contains("Operation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal)this).Operation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDisplayInternal)this).Operation, global::System.Convert.ToString); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDisplayInternal)this).Description, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -159,7 +159,7 @@ internal Display(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.BareMetal.Models.Api20210809.IDisplay FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDisplay FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Display.TypeConverter.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Display.TypeConverter.cs similarity index 97% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Display.TypeConverter.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/Display.TypeConverter.cs index 194cec868c45..dc2bf979b675 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Display.TypeConverter.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Display.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.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Models.Api20210809.IDisplay ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDisplay ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplay).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDisplay).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Display.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Display.cs similarity index 86% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Display.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/Display.cs index a86d682d4675..fac8d1ad130c 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Display.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Display.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.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions; /// Detailed BareMetal operation information public partial class Display : - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplay, - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDisplay, + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDisplayInternal { /// Backing field for property. @@ -21,16 +21,16 @@ public partial class Display : public string Description { get => this._description; } /// Internal Acessors for Description - string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal.Description { get => this._description; set { {_description = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDisplayInternal.Description { get => this._description; set { {_description = value;} } } /// Internal Acessors for Operation - string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal.Operation { get => this._operation; set { {_operation = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDisplayInternal.Operation { get => this._operation; set { {_operation = value;} } } /// Internal Acessors for Provider - string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal.Provider { get => this._provider; set { {_provider = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDisplayInternal.Provider { get => this._provider; set { {_provider = value;} } } /// Internal Acessors for Resource - string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal.Resource { get => this._resource; set { {_resource = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDisplayInternal.Resource { get => this._resource; set { {_resource = value;} } } /// Backing field for property. private string _operation; @@ -69,6 +69,9 @@ public partial interface IDisplay : [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The localized friendly description for the operation as shown to the user.", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -77,6 +80,9 @@ public partial interface IDisplay : [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The localized friendly name for the operation as shown to the user.", SerializedName = @"operation", PossibleTypes = new [] { typeof(string) })] @@ -85,6 +91,9 @@ public partial interface IDisplay : [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The localized friendly form of the resource provider name.", SerializedName = @"provider", PossibleTypes = new [] { typeof(string) })] @@ -95,6 +104,9 @@ public partial interface IDisplay : [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The localized friendly form of the resource type related to this action/operation.", SerializedName = @"resource", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Display.json.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Display.json.cs similarity index 89% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Display.json.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/Display.json.cs index 691221ee94aa..2aaadc3f0190 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Display.json.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Display.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.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions; @@ -65,21 +65,19 @@ internal Display(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonO { return; } - {_provider = If( json?.PropertyT("provider"), out var __jsonProvider) ? (string)__jsonProvider : (string)Provider;} - {_resource = If( json?.PropertyT("resource"), out var __jsonResource) ? (string)__jsonResource : (string)Resource;} - {_operation = If( json?.PropertyT("operation"), out var __jsonOperation) ? (string)__jsonOperation : (string)Operation;} - {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_provider = If( json?.PropertyT("provider"), out var __jsonProvider) ? (string)__jsonProvider : (string)_provider;} + {_resource = If( json?.PropertyT("resource"), out var __jsonResource) ? (string)__jsonResource : (string)_resource;} + {_operation = If( json?.PropertyT("operation"), out var __jsonOperation) ? (string)__jsonOperation : (string)_operation;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)_description;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplay. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDisplay. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplay. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplay FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDisplay. + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDisplay FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json ? new Display(json) : null; } @@ -103,19 +101,19 @@ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode ToJson { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._provider)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._provider.ToString()) : null, "provider" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._resource)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._resource.ToString()) : null, "resource" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._operation)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._operation.ToString()) : null, "operation" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); } diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/ErrorDefinition.PowerShell.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/ErrorDefinition.PowerShell.cs similarity index 74% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/ErrorDefinition.PowerShell.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/ErrorDefinition.PowerShell.cs index 427619f0f72b..71ad761e082f 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/ErrorDefinition.PowerShell.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/ErrorDefinition.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.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell; @@ -63,33 +63,33 @@ public partial class ErrorDefinition 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.BareMetal.Models.Api20210809.IErrorDefinition DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorDefinition DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ErrorDefinition(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.BareMetal.Models.Api20210809.IErrorDefinition DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorDefinition DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ErrorDefinition(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -104,21 +104,21 @@ internal ErrorDefinition(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinitionInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinitionInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorDefinitionInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorDefinitionInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinitionInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinitionInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorDefinitionInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorDefinitionInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("Detail")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinitionInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinition[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinitionInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ErrorDefinitionTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorDefinitionInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorDefinitionInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ErrorDefinitionTypeConverter.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. @@ -133,15 +133,15 @@ internal ErrorDefinition(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinitionInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinitionInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorDefinitionInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorDefinitionInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinitionInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinitionInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorDefinitionInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorDefinitionInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("Detail")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinitionInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinition[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinitionInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ErrorDefinitionTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorDefinitionInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorDefinitionInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ErrorDefinitionTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } @@ -151,7 +151,7 @@ internal ErrorDefinition(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.BareMetal.Models.Api20210809.IErrorDefinition FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorDefinition FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/ErrorDefinition.TypeConverter.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/ErrorDefinition.TypeConverter.cs similarity index 97% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/ErrorDefinition.TypeConverter.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/ErrorDefinition.TypeConverter.cs index edd1fd6da59b..8f50adac72bc 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/ErrorDefinition.TypeConverter.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/ErrorDefinition.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.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Models.Api20210809.IErrorDefinition ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorDefinition ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinition).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorDefinition).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/ErrorDefinition.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/ErrorDefinition.cs similarity index 72% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/ErrorDefinition.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/ErrorDefinition.cs index 32893e14c320..399742e5e7b6 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/ErrorDefinition.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/ErrorDefinition.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.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions; /// Error definition. public partial class ErrorDefinition : - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinition, - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinitionInternal + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorDefinition, + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorDefinitionInternal { /// Backing field for property. @@ -23,11 +23,11 @@ public partial class ErrorDefinition : public string Code { get => this._code; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinition[] _detail; + private System.Collections.Generic.List _detail; /// Internal error details. [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinition[] Detail { get => this._detail; } + public System.Collections.Generic.List Detail { get => this._detail; } /// Backing field for property. private string _message; @@ -37,13 +37,13 @@ public partial class ErrorDefinition : public string Message { get => this._message; } /// Internal Acessors for Code - string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinitionInternal.Code { get => this._code; set { {_code = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorDefinitionInternal.Code { get => this._code; set { {_code = value;} } } /// Internal Acessors for Detail - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinition[] Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinitionInternal.Detail { get => this._detail; set { {_detail = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorDefinitionInternal.Detail { get => this._detail; set { {_detail = value;} } } /// Internal Acessors for Message - string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinitionInternal.Message { get => this._message; set { {_message = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorDefinitionInternal.Message { get => this._message; set { {_message = value;} } } /// Creates an new instance. public ErrorDefinition() @@ -61,6 +61,9 @@ public partial interface IErrorDefinition : [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Service specific error code which serves as the substatus for the HTTP error code.", SerializedName = @"code", PossibleTypes = new [] { typeof(string) })] @@ -69,14 +72,20 @@ public partial interface IErrorDefinition : [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Internal error details.", SerializedName = @"details", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinition) })] - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinition[] Detail { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorDefinition) })] + System.Collections.Generic.List Detail { get; } /// Description of the error. [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Description of the error.", SerializedName = @"message", PossibleTypes = new [] { typeof(string) })] @@ -92,7 +101,7 @@ internal partial interface IErrorDefinitionInternal /// string Code { get; set; } /// Internal error details. - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinition[] Detail { get; set; } + System.Collections.Generic.List Detail { get; set; } /// Description of the error. string Message { get; set; } diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/ErrorDefinition.json.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/ErrorDefinition.json.cs similarity index 88% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/ErrorDefinition.json.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/ErrorDefinition.json.cs index 35f72b96698f..4f788b8069d0 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/ErrorDefinition.json.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/ErrorDefinition.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.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions; @@ -65,20 +65,20 @@ internal ErrorDefinition(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Js { 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;} - {_detail = If( json?.PropertyT("details"), out var __jsonDetails) ? If( __jsonDetails as Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Models.Api20210809.IErrorDefinition) (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ErrorDefinition.FromJson(__u) )) ))() : null : 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;} + {_detail = If( json?.PropertyT("details"), out var __jsonDetails) ? If( __jsonDetails as Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Models.IErrorDefinition) (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ErrorDefinition.FromJson(__u) )) ))() : null : _detail;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinition. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorDefinition. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinition. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorDefinition. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinition FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorDefinition FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json ? new ErrorDefinition(json) : null; } @@ -102,15 +102,15 @@ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode ToJson { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._code)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._code.ToString()) : null, "code" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._message.ToString()) : null, "message" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeRead)) { if (null != this._detail) { diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/ErrorResponse.PowerShell.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/ErrorResponse.PowerShell.cs similarity index 70% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/ErrorResponse.PowerShell.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/ErrorResponse.PowerShell.cs index 83acffd43ad3..9d8de6974282 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/ErrorResponse.PowerShell.cs +++ b/generated/BareMetal/BareMetal.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.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell; @@ -63,33 +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.BareMetal.Models.Api20210809.IErrorResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Models.Api20210809.IErrorResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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. @@ -104,25 +104,25 @@ internal ErrorResponse(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Error")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinition) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ErrorDefinitionTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorDefinition) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ErrorDefinitionTypeConverter.ConvertFrom); } if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorResponseInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorResponseInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorResponseInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("Detail")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorResponseInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinition[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ErrorDefinitionTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ErrorDefinitionTypeConverter.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,19 +137,19 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Error")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinition) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ErrorDefinitionTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorDefinition) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ErrorDefinitionTypeConverter.ConvertFrom); } if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorResponseInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorResponseInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorResponseInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("Detail")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorResponseInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinition[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ErrorDefinitionTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ErrorDefinitionTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } @@ -159,7 +159,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.BareMetal.Models.Api20210809.IErrorResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/ErrorResponse.TypeConverter.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/ErrorResponse.TypeConverter.cs similarity index 97% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/ErrorResponse.TypeConverter.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/ErrorResponse.TypeConverter.cs index 7a042807699a..2b9e7c612a5c 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/ErrorResponse.TypeConverter.cs +++ b/generated/BareMetal/BareMetal.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.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Models.Api20210809.IErrorResponse ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorResponse ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorResponse).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorResponse).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/ErrorResponse.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/ErrorResponse.cs similarity index 60% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/ErrorResponse.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/ErrorResponse.cs index c9110a047a7d..7afb2f83c526 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/ErrorResponse.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/ErrorResponse.cs @@ -3,48 +3,48 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions; /// Error response. public partial class ErrorResponse : - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorResponse, - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorResponseInternal + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorResponse, + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorResponseInternal { /// /// Service specific error code which serves as the substatus for the HTTP error code. /// [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)] - public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinitionInternal)Error).Code; } + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorDefinitionInternal)Error).Code; } /// Internal error details. [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinition[] Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinitionInternal)Error).Detail; } + public System.Collections.Generic.List Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorDefinitionInternal)Error).Detail; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinition _error; + private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorDefinition _error; /// The error details. [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinition Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ErrorDefinition()); set => this._error = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorDefinition Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ErrorDefinition()); set => this._error = value; } /// Description of the error. [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)] - public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinitionInternal)Error).Message; } + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorDefinitionInternal)Error).Message; } /// Internal Acessors for Code - string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorResponseInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinitionInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinitionInternal)Error).Code = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorResponseInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorDefinitionInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorDefinitionInternal)Error).Code = value; } /// Internal Acessors for Detail - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinition[] Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorResponseInternal.Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinitionInternal)Error).Detail; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinitionInternal)Error).Detail = value; } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorResponseInternal.Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorDefinitionInternal)Error).Detail; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorDefinitionInternal)Error).Detail = value; } /// Internal Acessors for Error - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinition Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorResponseInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ErrorDefinition()); set { {_error = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorDefinition Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorResponseInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ErrorDefinition()); set { {_error = value;} } } /// Internal Acessors for Message - string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorResponseInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinitionInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinitionInternal)Error).Message = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorResponseInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorDefinitionInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorDefinitionInternal)Error).Message = value; } /// Creates an new instance. public ErrorResponse() @@ -62,6 +62,9 @@ public partial interface IErrorResponse : [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Service specific error code which serves as the substatus for the HTTP error code.", SerializedName = @"code", PossibleTypes = new [] { typeof(string) })] @@ -70,14 +73,20 @@ public partial interface IErrorResponse : [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Internal error details.", SerializedName = @"details", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinition) })] - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinition[] Detail { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorDefinition) })] + System.Collections.Generic.List Detail { get; } /// Description of the error. [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Description of the error.", SerializedName = @"message", PossibleTypes = new [] { typeof(string) })] @@ -93,9 +102,9 @@ internal partial interface IErrorResponseInternal /// string Code { get; set; } /// Internal error details. - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinition[] Detail { get; set; } + System.Collections.Generic.List Detail { get; set; } /// The error details. - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinition Error { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorDefinition Error { get; set; } /// Description of the error. string Message { get; set; } diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/ErrorResponse.json.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/ErrorResponse.json.cs similarity index 94% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/ErrorResponse.json.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/ErrorResponse.json.cs index 6f6a54a90232..bf164cb40835 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/ErrorResponse.json.cs +++ b/generated/BareMetal/BareMetal.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.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions; @@ -65,18 +65,18 @@ internal ErrorResponse(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json { return; } - {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ErrorDefinition.FromJson(__jsonError) : Error;} + {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ErrorDefinition.FromJson(__jsonError) : _error;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorResponse. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorResponse. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorResponse. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorResponse. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json ? new ErrorResponse(json) : null; } diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/HardwareProfile.PowerShell.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/HardwareProfile.PowerShell.cs similarity index 75% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/HardwareProfile.PowerShell.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/HardwareProfile.PowerShell.cs index 656dc501a02f..63148f5720d1 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/HardwareProfile.PowerShell.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/HardwareProfile.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.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class HardwareProfile 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.BareMetal.Models.Api20210809.IHardwareProfile DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IHardwareProfile DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new HardwareProfile(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.BareMetal.Models.Api20210809.IHardwareProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IHardwareProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new HardwareProfile(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IH /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IHardwareProfile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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 HardwareProfile(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("HardwareType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfileInternal)this).HardwareType = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum?) content.GetValueForProperty("HardwareType",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfileInternal)this).HardwareType, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IHardwareProfileInternal)this).HardwareType = (string) content.GetValueForProperty("HardwareType",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IHardwareProfileInternal)this).HardwareType, global::System.Convert.ToString); } if (content.Contains("AzureBareMetalInstanceSize")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfileInternal)this).AzureBareMetalInstanceSize = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum?) content.GetValueForProperty("AzureBareMetalInstanceSize",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfileInternal)this).AzureBareMetalInstanceSize, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IHardwareProfileInternal)this).AzureBareMetalInstanceSize = (string) content.GetValueForProperty("AzureBareMetalInstanceSize",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IHardwareProfileInternal)this).AzureBareMetalInstanceSize, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -136,11 +136,11 @@ internal HardwareProfile(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("HardwareType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfileInternal)this).HardwareType = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum?) content.GetValueForProperty("HardwareType",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfileInternal)this).HardwareType, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IHardwareProfileInternal)this).HardwareType = (string) content.GetValueForProperty("HardwareType",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IHardwareProfileInternal)this).HardwareType, global::System.Convert.ToString); } if (content.Contains("AzureBareMetalInstanceSize")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfileInternal)this).AzureBareMetalInstanceSize = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum?) content.GetValueForProperty("AzureBareMetalInstanceSize",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfileInternal)this).AzureBareMetalInstanceSize, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IHardwareProfileInternal)this).AzureBareMetalInstanceSize = (string) content.GetValueForProperty("AzureBareMetalInstanceSize",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IHardwareProfileInternal)this).AzureBareMetalInstanceSize, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/HardwareProfile.TypeConverter.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/HardwareProfile.TypeConverter.cs similarity index 97% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/HardwareProfile.TypeConverter.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/HardwareProfile.TypeConverter.cs index b5d19799e139..e4d5329993d1 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/HardwareProfile.TypeConverter.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/HardwareProfile.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.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Models.Api20210809.IHardwareProfile ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IHardwareProfile ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfile).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IHardwareProfile).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/HardwareProfile.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/HardwareProfile.cs similarity index 51% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/HardwareProfile.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/HardwareProfile.cs index 8f1c1b2f27e7..a63cd1e4e685 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/HardwareProfile.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/HardwareProfile.cs @@ -3,35 +3,35 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions; /// Specifies the hardware settings for the AzureBareMetal instance. public partial class HardwareProfile : - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfile, - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfileInternal + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IHardwareProfile, + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IHardwareProfileInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum? _azureBareMetalInstanceSize; + private string _azureBareMetalInstanceSize; /// Specifies the AzureBareMetal instance SKU. [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum? AzureBareMetalInstanceSize { get => this._azureBareMetalInstanceSize; } + public string AzureBareMetalInstanceSize { get => this._azureBareMetalInstanceSize; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum? _hardwareType; + private string _hardwareType; /// Name of the hardware type (vendor and/or their product name) [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum? HardwareType { get => this._hardwareType; } + public string HardwareType { get => this._hardwareType; } /// Internal Acessors for AzureBareMetalInstanceSize - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum? Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfileInternal.AzureBareMetalInstanceSize { get => this._azureBareMetalInstanceSize; set { {_azureBareMetalInstanceSize = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IHardwareProfileInternal.AzureBareMetalInstanceSize { get => this._azureBareMetalInstanceSize; set { {_azureBareMetalInstanceSize = value;} } } /// Internal Acessors for HardwareType - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum? Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfileInternal.HardwareType { get => this._hardwareType; set { {_hardwareType = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IHardwareProfileInternal.HardwareType { get => this._hardwareType; set { {_hardwareType = value;} } } /// Creates an new instance. public HardwareProfile() @@ -47,18 +47,26 @@ public partial interface IHardwareProfile : [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Specifies the AzureBareMetal instance SKU.", SerializedName = @"azureBareMetalInstanceSize", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum) })] - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum? AzureBareMetalInstanceSize { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PSArgumentCompleterAttribute("S72m", "S144m", "S72", "S144", "S192", "S192m", "S192xm", "S96", "S112", "S224", "S224m", "S224om", "S224oo", "S224oom", "S224ooo", "S384", "S384m", "S384xm", "S384xxm", "S448", "S448m", "S448om", "S448oo", "S448oom", "S448ooo", "S576m", "S576xm", "S672", "S672m", "S672om", "S672oo", "S672oom", "S672ooo", "S768", "S768m", "S768xm", "S896", "S896m", "S896om", "S896oo", "S896oom", "S896ooo", "S960m")] + string AzureBareMetalInstanceSize { get; } /// Name of the hardware type (vendor and/or their product name) [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Name of the hardware type (vendor and/or their product name)", SerializedName = @"hardwareType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum) })] - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum? HardwareType { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PSArgumentCompleterAttribute("Cisco_UCS", "HPE")] + string HardwareType { get; } } /// Specifies the hardware settings for the AzureBareMetal instance. @@ -66,9 +74,11 @@ internal partial interface IHardwareProfileInternal { /// Specifies the AzureBareMetal instance SKU. - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum? AzureBareMetalInstanceSize { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PSArgumentCompleterAttribute("S72m", "S144m", "S72", "S144", "S192", "S192m", "S192xm", "S96", "S112", "S224", "S224m", "S224om", "S224oo", "S224oom", "S224ooo", "S384", "S384m", "S384xm", "S384xxm", "S448", "S448m", "S448om", "S448oo", "S448oom", "S448ooo", "S576m", "S576xm", "S672", "S672m", "S672om", "S672oo", "S672oom", "S672ooo", "S768", "S768m", "S768xm", "S896", "S896m", "S896om", "S896oo", "S896oom", "S896ooo", "S960m")] + string AzureBareMetalInstanceSize { get; set; } /// Name of the hardware type (vendor and/or their product name) - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum? HardwareType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PSArgumentCompleterAttribute("Cisco_UCS", "HPE")] + string HardwareType { get; set; } } } \ No newline at end of file diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/HardwareProfile.json.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/HardwareProfile.json.cs similarity index 93% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/HardwareProfile.json.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/HardwareProfile.json.cs index 7c26c19cdb4b..2eadff71f923 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/HardwareProfile.json.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/HardwareProfile.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.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class HardwareProfile partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfile. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IHardwareProfile. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfile. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IHardwareProfile. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IHardwareProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json ? new HardwareProfile(json) : null; } @@ -77,8 +77,8 @@ internal HardwareProfile(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Js { return; } - {_hardwareType = If( json?.PropertyT("hardwareType"), out var __jsonHardwareType) ? (string)__jsonHardwareType : (string)HardwareType;} - {_azureBareMetalInstanceSize = If( json?.PropertyT("azureBareMetalInstanceSize"), out var __jsonAzureBareMetalInstanceSize) ? (string)__jsonAzureBareMetalInstanceSize : (string)AzureBareMetalInstanceSize;} + {_hardwareType = If( json?.PropertyT("hardwareType"), out var __jsonHardwareType) ? (string)__jsonHardwareType : (string)_hardwareType;} + {_azureBareMetalInstanceSize = If( json?.PropertyT("azureBareMetalInstanceSize"), out var __jsonAzureBareMetalInstanceSize) ? (string)__jsonAzureBareMetalInstanceSize : (string)_azureBareMetalInstanceSize;} AfterFromJson(json); } @@ -101,11 +101,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode ToJson { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._hardwareType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._hardwareType.ToString()) : null, "hardwareType" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._azureBareMetalInstanceSize)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._azureBareMetalInstanceSize.ToString()) : null, "azureBareMetalInstanceSize" ,container.Add ); } diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/IPAddress.PowerShell.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/IPAddress.PowerShell.cs similarity index 85% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/IPAddress.PowerShell.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/IPAddress.PowerShell.cs index 16a693637690..3b6310834365 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/IPAddress.PowerShell.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/IPAddress.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.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class IPAddress 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.BareMetal.Models.Api20210809.IIPAddress DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IIPAddress DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new IPAddress(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.BareMetal.Models.Api20210809.IIPAddress DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IIPAddress DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new IPAddress(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.II /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IIPAddress FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IIPAddress FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -111,13 +111,13 @@ internal IPAddress(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("IPAddress1")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IIPAddressInternal)this).IPAddress1 = (string) content.GetValueForProperty("IPAddress1",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IIPAddressInternal)this).IPAddress1, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IIPAddressInternal)this).IPAddress1 = (string) content.GetValueForProperty("IPAddress1",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IIPAddressInternal)this).IPAddress1, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -132,7 +132,7 @@ internal IPAddress(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("IPAddress1")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IIPAddressInternal)this).IPAddress1 = (string) content.GetValueForProperty("IPAddress1",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IIPAddressInternal)this).IPAddress1, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IIPAddressInternal)this).IPAddress1 = (string) content.GetValueForProperty("IPAddress1",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IIPAddressInternal)this).IPAddress1, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/IPAddress.TypeConverter.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/IPAddress.TypeConverter.cs similarity index 97% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/IPAddress.TypeConverter.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/IPAddress.TypeConverter.cs index 31560896ad52..63b5bb7b9909 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/IPAddress.TypeConverter.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/IPAddress.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.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Models.Api20210809.IIPAddress ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IIPAddress ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IIPAddress).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IIPAddress).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/IPAddress.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/IPAddress.cs similarity index 87% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/IPAddress.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/IPAddress.cs index 2773d4d459f6..9ab2b3e15ed6 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/IPAddress.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/IPAddress.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.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions; /// Specifies the IP address of the network interface. public partial class IPAddress : - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IIPAddress, - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IIPAddressInternal + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IIPAddress, + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IIPAddressInternal { /// Backing field for property. @@ -34,6 +34,9 @@ public partial interface IIPAddress : [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Specifies the IP address of the network interface.", SerializedName = @"ipAddress", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/IPAddress.json.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/IPAddress.json.cs similarity index 93% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/IPAddress.json.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/IPAddress.json.cs index f6798bf8c846..7db32eb049b3 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/IPAddress.json.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/IPAddress.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.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions; @@ -54,13 +54,11 @@ public partial class IPAddress partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IIPAddress. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IIPAddress. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IIPAddress. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IIPAddress FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IIPAddress. + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IIPAddress FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json ? new IPAddress(json) : null; } @@ -77,7 +75,7 @@ internal IPAddress(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.Jso { return; } - {_iPAddress1 = If( json?.PropertyT("ipAddress"), out var __jsonIPAddress) ? (string)__jsonIPAddress : (string)IPAddress1;} + {_iPAddress1 = If( json?.PropertyT("ipAddress"), out var __jsonIPAddress) ? (string)__jsonIPAddress : (string)_iPAddress1;} AfterFromJson(json); } diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/NetworkProfile.PowerShell.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/NetworkProfile.PowerShell.cs similarity index 77% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/NetworkProfile.PowerShell.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/NetworkProfile.PowerShell.cs index 9df420fe9fce..2d1384bd2f31 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/NetworkProfile.PowerShell.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/NetworkProfile.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.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class NetworkProfile 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.BareMetal.Models.Api20210809.INetworkProfile DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.INetworkProfile DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new NetworkProfile(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.BareMetal.Models.Api20210809.INetworkProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.INetworkProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new NetworkProfile(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IN /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.INetworkProfile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.INetworkProfile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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 NetworkProfile(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("NetworkInterface")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.INetworkProfileInternal)this).NetworkInterface = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IIPAddress[]) content.GetValueForProperty("NetworkInterface",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.INetworkProfileInternal)this).NetworkInterface, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IPAddressTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.INetworkProfileInternal)this).NetworkInterface = (System.Collections.Generic.List) content.GetValueForProperty("NetworkInterface",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.INetworkProfileInternal)this).NetworkInterface, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IPAddressTypeConverter.ConvertFrom)); } if (content.Contains("CircuitId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.INetworkProfileInternal)this).CircuitId = (string) content.GetValueForProperty("CircuitId",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.INetworkProfileInternal)this).CircuitId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.INetworkProfileInternal)this).CircuitId = (string) content.GetValueForProperty("CircuitId",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.INetworkProfileInternal)this).CircuitId, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -136,11 +136,11 @@ internal NetworkProfile(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("NetworkInterface")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.INetworkProfileInternal)this).NetworkInterface = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IIPAddress[]) content.GetValueForProperty("NetworkInterface",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.INetworkProfileInternal)this).NetworkInterface, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IPAddressTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.INetworkProfileInternal)this).NetworkInterface = (System.Collections.Generic.List) content.GetValueForProperty("NetworkInterface",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.INetworkProfileInternal)this).NetworkInterface, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IPAddressTypeConverter.ConvertFrom)); } if (content.Contains("CircuitId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.INetworkProfileInternal)this).CircuitId = (string) content.GetValueForProperty("CircuitId",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.INetworkProfileInternal)this).CircuitId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.INetworkProfileInternal)this).CircuitId = (string) content.GetValueForProperty("CircuitId",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.INetworkProfileInternal)this).CircuitId, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/NetworkProfile.TypeConverter.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/NetworkProfile.TypeConverter.cs similarity index 97% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/NetworkProfile.TypeConverter.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/NetworkProfile.TypeConverter.cs index c98d5b4b1238..8e244e0b6c6b 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/NetworkProfile.TypeConverter.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/NetworkProfile.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.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Models.Api20210809.INetworkProfile ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.INetworkProfile ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.INetworkProfile).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.INetworkProfile).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/NetworkProfile.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/NetworkProfile.cs similarity index 72% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/NetworkProfile.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/NetworkProfile.cs index 881db5e5db7f..d3578e356607 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/NetworkProfile.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/NetworkProfile.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.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions; /// Specifies the network settings for the AzureBareMetal instance disks. public partial class NetworkProfile : - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.INetworkProfile, - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.INetworkProfileInternal + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.INetworkProfile, + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.INetworkProfileInternal { /// Backing field for property. @@ -21,14 +21,14 @@ public partial class NetworkProfile : public string CircuitId { get => this._circuitId; } /// Internal Acessors for CircuitId - string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.INetworkProfileInternal.CircuitId { get => this._circuitId; set { {_circuitId = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.INetworkProfileInternal.CircuitId { get => this._circuitId; set { {_circuitId = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IIPAddress[] _networkInterface; + private System.Collections.Generic.List _networkInterface; /// Specifies the network interfaces for the AzureBareMetal instance. [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IIPAddress[] NetworkInterface { get => this._networkInterface; set => this._networkInterface = value; } + public System.Collections.Generic.List NetworkInterface { get => this._networkInterface; set => this._networkInterface = value; } /// Creates an new instance. public NetworkProfile() @@ -44,6 +44,9 @@ public partial interface INetworkProfile : [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Specifies the circuit id for connecting to express route.", SerializedName = @"circuitId", PossibleTypes = new [] { typeof(string) })] @@ -52,10 +55,13 @@ public partial interface INetworkProfile : [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Specifies the network interfaces for the AzureBareMetal instance.", SerializedName = @"networkInterfaces", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IIPAddress) })] - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IIPAddress[] NetworkInterface { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IIPAddress) })] + System.Collections.Generic.List NetworkInterface { get; set; } } /// Specifies the network settings for the AzureBareMetal instance disks. @@ -65,7 +71,7 @@ internal partial interface INetworkProfileInternal /// Specifies the circuit id for connecting to express route. string CircuitId { get; set; } /// Specifies the network interfaces for the AzureBareMetal instance. - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IIPAddress[] NetworkInterface { get; set; } + System.Collections.Generic.List NetworkInterface { get; set; } } } \ No newline at end of file diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/NetworkProfile.json.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/NetworkProfile.json.cs similarity index 89% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/NetworkProfile.json.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/NetworkProfile.json.cs index 0f5bc32401ea..d1eb3a1a55ef 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/NetworkProfile.json.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/NetworkProfile.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.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class NetworkProfile partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.INetworkProfile. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.INetworkProfile. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.INetworkProfile. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.INetworkProfile. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.INetworkProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.INetworkProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json ? new NetworkProfile(json) : null; } @@ -77,8 +77,8 @@ internal NetworkProfile(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Jso { return; } - {_networkInterface = If( json?.PropertyT("networkInterfaces"), out var __jsonNetworkInterfaces) ? If( __jsonNetworkInterfaces as Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Models.Api20210809.IIPAddress) (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IPAddress.FromJson(__u) )) ))() : null : NetworkInterface;} - {_circuitId = If( json?.PropertyT("circuitId"), out var __jsonCircuitId) ? (string)__jsonCircuitId : (string)CircuitId;} + {_networkInterface = If( json?.PropertyT("networkInterfaces"), out var __jsonNetworkInterfaces) ? If( __jsonNetworkInterfaces as Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Models.IIPAddress) (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IPAddress.FromJson(__u) )) ))() : null : _networkInterface;} + {_circuitId = If( json?.PropertyT("circuitId"), out var __jsonCircuitId) ? (string)__jsonCircuitId : (string)_circuitId;} AfterFromJson(json); } @@ -110,7 +110,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode ToJson } container.Add("networkInterfaces",__w); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._circuitId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._circuitId.ToString()) : null, "circuitId" ,container.Add ); } diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/OSProfile.PowerShell.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/OSProfile.PowerShell.cs similarity index 75% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/OSProfile.PowerShell.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/OSProfile.PowerShell.cs index ce308ed6e0fc..56bc819ae0a9 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/OSProfile.PowerShell.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/OSProfile.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.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class OSProfile 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.BareMetal.Models.Api20210809.IOSProfile DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOSProfile DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new OSProfile(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.BareMetal.Models.Api20210809.IOSProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOSProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new OSProfile(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IO /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOSProfile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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 OSProfile(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("ComputerName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfileInternal)this).ComputerName = (string) content.GetValueForProperty("ComputerName",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfileInternal)this).ComputerName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOSProfileInternal)this).ComputerName = (string) content.GetValueForProperty("ComputerName",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOSProfileInternal)this).ComputerName, global::System.Convert.ToString); } if (content.Contains("OSType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfileInternal)this).OSType = (string) content.GetValueForProperty("OSType",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfileInternal)this).OSType, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOSProfileInternal)this).OSType = (string) content.GetValueForProperty("OSType",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOSProfileInternal)this).OSType, global::System.Convert.ToString); } if (content.Contains("Version")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfileInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfileInternal)this).Version, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOSProfileInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOSProfileInternal)this).Version, global::System.Convert.ToString); } if (content.Contains("SshPublicKey")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfileInternal)this).SshPublicKey = (string) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfileInternal)this).SshPublicKey, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOSProfileInternal)this).SshPublicKey = (string) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOSProfileInternal)this).SshPublicKey, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -144,19 +144,19 @@ internal OSProfile(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("ComputerName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfileInternal)this).ComputerName = (string) content.GetValueForProperty("ComputerName",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfileInternal)this).ComputerName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOSProfileInternal)this).ComputerName = (string) content.GetValueForProperty("ComputerName",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOSProfileInternal)this).ComputerName, global::System.Convert.ToString); } if (content.Contains("OSType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfileInternal)this).OSType = (string) content.GetValueForProperty("OSType",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfileInternal)this).OSType, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOSProfileInternal)this).OSType = (string) content.GetValueForProperty("OSType",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOSProfileInternal)this).OSType, global::System.Convert.ToString); } if (content.Contains("Version")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfileInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfileInternal)this).Version, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOSProfileInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOSProfileInternal)this).Version, global::System.Convert.ToString); } if (content.Contains("SshPublicKey")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfileInternal)this).SshPublicKey = (string) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfileInternal)this).SshPublicKey, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOSProfileInternal)this).SshPublicKey = (string) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOSProfileInternal)this).SshPublicKey, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/OSProfile.TypeConverter.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/OSProfile.TypeConverter.cs similarity index 97% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/OSProfile.TypeConverter.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/OSProfile.TypeConverter.cs index a8cb4808501a..aaa70a51c75d 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/OSProfile.TypeConverter.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/OSProfile.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.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Models.Api20210809.IOSProfile ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOSProfile ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfile).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOSProfile).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/OSProfile.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/OSProfile.cs similarity index 88% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/OSProfile.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/OSProfile.cs index ef96bcea57b7..1e2b578438e6 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/OSProfile.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/OSProfile.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.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions; /// Specifies the operating system settings for the AzureBareMetal instance. public partial class OSProfile : - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfile, - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfileInternal + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOSProfile, + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOSProfileInternal { /// Backing field for property. @@ -21,10 +21,10 @@ public partial class OSProfile : public string ComputerName { get => this._computerName; set => this._computerName = value; } /// Internal Acessors for OSType - string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfileInternal.OSType { get => this._oSType; set { {_oSType = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOSProfileInternal.OSType { get => this._oSType; set { {_oSType = value;} } } /// Internal Acessors for Version - string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfileInternal.Version { get => this._version; set { {_version = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOSProfileInternal.Version { get => this._version; set { {_version = value;} } } /// Backing field for property. private string _oSType; @@ -61,6 +61,9 @@ public partial interface IOSProfile : [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Specifies the host OS name of the AzureBareMetal instance.", SerializedName = @"computerName", PossibleTypes = new [] { typeof(string) })] @@ -69,6 +72,9 @@ public partial interface IOSProfile : [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"This property allows you to specify the type of the OS.", SerializedName = @"osType", PossibleTypes = new [] { typeof(string) })] @@ -77,6 +83,9 @@ public partial interface IOSProfile : [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Specifies the SSH public key used to access the operating system.", SerializedName = @"sshPublicKey", PossibleTypes = new [] { typeof(string) })] @@ -85,6 +94,9 @@ public partial interface IOSProfile : [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Specifies version of operating system.", SerializedName = @"version", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/OSProfile.json.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/OSProfile.json.cs similarity index 91% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/OSProfile.json.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/OSProfile.json.cs index 44d4d7354fed..3b77f47dd031 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/OSProfile.json.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/OSProfile.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.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions; @@ -54,13 +54,11 @@ public partial class OSProfile partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfile. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOSProfile. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfile. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOSProfile. + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOSProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json ? new OSProfile(json) : null; } @@ -77,10 +75,10 @@ internal OSProfile(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.Jso { return; } - {_computerName = If( json?.PropertyT("computerName"), out var __jsonComputerName) ? (string)__jsonComputerName : (string)ComputerName;} - {_oSType = If( json?.PropertyT("osType"), out var __jsonOSType) ? (string)__jsonOSType : (string)OSType;} - {_version = If( json?.PropertyT("version"), out var __jsonVersion) ? (string)__jsonVersion : (string)Version;} - {_sshPublicKey = If( json?.PropertyT("sshPublicKey"), out var __jsonSshPublicKey) ? (string)__jsonSshPublicKey : (string)SshPublicKey;} + {_computerName = If( json?.PropertyT("computerName"), out var __jsonComputerName) ? (string)__jsonComputerName : (string)_computerName;} + {_oSType = If( json?.PropertyT("osType"), out var __jsonOSType) ? (string)__jsonOSType : (string)_oSType;} + {_version = If( json?.PropertyT("version"), out var __jsonVersion) ? (string)__jsonVersion : (string)_version;} + {_sshPublicKey = If( json?.PropertyT("sshPublicKey"), out var __jsonSshPublicKey) ? (string)__jsonSshPublicKey : (string)_sshPublicKey;} AfterFromJson(json); } @@ -104,11 +102,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode ToJson return container; } AddIf( null != (((object)this._computerName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._computerName.ToString()) : null, "computerName" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._oSType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._oSType.ToString()) : null, "osType" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._version)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._version.ToString()) : null, "version" ,container.Add ); } diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Operation.PowerShell.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Operation.PowerShell.cs similarity index 67% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Operation.PowerShell.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/Operation.PowerShell.cs index a46a1e60846a..0b57652115e8 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Operation.PowerShell.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Operation.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class Operation partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperation DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperation DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new Operation(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new Operation(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IO /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -111,37 +111,37 @@ internal Operation(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Display")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.DisplayTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperationInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperationInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.DisplayTypeConverter.ConvertFrom); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperationInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("IsDataAction")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal)this).IsDataAction = (bool?) content.GetValueForProperty("IsDataAction",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal)this).IsDataAction, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperationInternal)this).IsDataAction = (bool?) content.GetValueForProperty("IsDataAction",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperationInternal)this).IsDataAction, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("DisplayProvider")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal)this).DisplayProvider, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperationInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperationInternal)this).DisplayProvider, global::System.Convert.ToString); } if (content.Contains("DisplayResource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal)this).DisplayResource, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperationInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperationInternal)this).DisplayResource, global::System.Convert.ToString); } if (content.Contains("DisplayOperation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal)this).DisplayOperation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperationInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperationInternal)this).DisplayOperation, global::System.Convert.ToString); } if (content.Contains("DisplayDescription")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal)this).DisplayDescription, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperationInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperationInternal)this).DisplayDescription, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -156,31 +156,31 @@ internal Operation(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Display")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.DisplayTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperationInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperationInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.DisplayTypeConverter.ConvertFrom); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperationInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("IsDataAction")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal)this).IsDataAction = (bool?) content.GetValueForProperty("IsDataAction",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal)this).IsDataAction, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperationInternal)this).IsDataAction = (bool?) content.GetValueForProperty("IsDataAction",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperationInternal)this).IsDataAction, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("DisplayProvider")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal)this).DisplayProvider, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperationInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperationInternal)this).DisplayProvider, global::System.Convert.ToString); } if (content.Contains("DisplayResource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal)this).DisplayResource, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperationInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperationInternal)this).DisplayResource, global::System.Convert.ToString); } if (content.Contains("DisplayOperation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal)this).DisplayOperation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperationInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperationInternal)this).DisplayOperation, global::System.Convert.ToString); } if (content.Contains("DisplayDescription")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal)this).DisplayDescription, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperationInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperationInternal)this).DisplayDescription, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Operation.TypeConverter.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Operation.TypeConverter.cs similarity index 97% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Operation.TypeConverter.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/Operation.TypeConverter.cs index 974f018e951e..d23234ee1087 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Operation.TypeConverter.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Operation.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Models.Api20210809.IOperation ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperation ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperation).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperation).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Operation.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Operation.cs similarity index 75% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Operation.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/Operation.cs index 4f4d13863b29..0f51cefcadcd 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Operation.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Operation.cs @@ -3,40 +3,40 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions; /// AzureBareMetal operation information public partial class Operation : - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperation, - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperation, + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperationInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplay _display; + private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDisplay _display; /// Displayed AzureBareMetal operation information [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplay Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.Display()); set => this._display = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDisplay Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Display()); set => this._display = value; } /// The localized friendly description for the operation as shown to the user. [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)] - public string DisplayDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal)Display).Description; } + public string DisplayDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDisplayInternal)Display).Description; } /// The localized friendly name for the operation as shown to the user. [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)] - public string DisplayOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal)Display).Operation; } + public string DisplayOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDisplayInternal)Display).Operation; } /// The localized friendly form of the resource provider name. [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)] - public string DisplayProvider { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal)Display).Provider; } + public string DisplayProvider { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDisplayInternal)Display).Provider; } /// /// The localized friendly form of the resource type related to this action/operation. /// [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)] - public string DisplayResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal)Display).Resource; } + public string DisplayResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDisplayInternal)Display).Resource; } /// Backing field for property. private bool? _isDataAction; @@ -46,25 +46,25 @@ public partial class Operation : public bool? IsDataAction { get => this._isDataAction; } /// Internal Acessors for Display - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplay Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal.Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.Display()); set { {_display = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDisplay Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperationInternal.Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Display()); set { {_display = value;} } } /// Internal Acessors for DisplayDescription - string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal.DisplayDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal)Display).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal)Display).Description = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperationInternal.DisplayDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDisplayInternal)Display).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDisplayInternal)Display).Description = value; } /// Internal Acessors for DisplayOperation - string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal.DisplayOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal)Display).Operation; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal)Display).Operation = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperationInternal.DisplayOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDisplayInternal)Display).Operation; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDisplayInternal)Display).Operation = value; } /// Internal Acessors for DisplayProvider - string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal.DisplayProvider { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal)Display).Provider; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal)Display).Provider = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperationInternal.DisplayProvider { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDisplayInternal)Display).Provider; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDisplayInternal)Display).Provider = value; } /// Internal Acessors for DisplayResource - string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal.DisplayResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal)Display).Resource; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal)Display).Resource = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperationInternal.DisplayResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDisplayInternal)Display).Resource; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDisplayInternal)Display).Resource = value; } /// Internal Acessors for IsDataAction - bool? Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal.IsDataAction { get => this._isDataAction; set { {_isDataAction = value;} } } + bool? Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperationInternal.IsDataAction { get => this._isDataAction; set { {_isDataAction = value;} } } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperationInternal.Name { get => this._name; set { {_name = value;} } } /// Backing field for property. private string _name; @@ -90,6 +90,9 @@ public partial interface IOperation : [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The localized friendly description for the operation as shown to the user.", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -98,6 +101,9 @@ public partial interface IOperation : [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The localized friendly name for the operation as shown to the user.", SerializedName = @"operation", PossibleTypes = new [] { typeof(string) })] @@ -106,6 +112,9 @@ public partial interface IOperation : [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The localized friendly form of the resource provider name.", SerializedName = @"provider", PossibleTypes = new [] { typeof(string) })] @@ -116,6 +125,9 @@ public partial interface IOperation : [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The localized friendly form of the resource type related to this action/operation.", SerializedName = @"resource", PossibleTypes = new [] { typeof(string) })] @@ -124,6 +136,9 @@ public partial interface IOperation : [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"indicates whether an operation is a data action or not.", SerializedName = @"isDataAction", PossibleTypes = new [] { typeof(bool) })] @@ -135,6 +150,9 @@ public partial interface IOperation : [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The name of the operation being performed on this particular object. This name should match the action name that appears in RBAC / the event service.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -146,7 +164,7 @@ internal partial interface IOperationInternal { /// Displayed AzureBareMetal operation information - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplay Display { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDisplay Display { get; set; } /// The localized friendly description for the operation as shown to the user. string DisplayDescription { get; set; } /// The localized friendly name for the operation as shown to the user. diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Operation.json.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Operation.json.cs similarity index 91% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Operation.json.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/Operation.json.cs index 30e147ea9ae8..b102062b69e0 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Operation.json.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Operation.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions; @@ -54,13 +54,11 @@ public partial class Operation partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperation. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperation. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperation. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperation FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperation. + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperation FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json ? new Operation(json) : null; } @@ -77,9 +75,9 @@ internal Operation(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.Jso { return; } - {_display = If( json?.PropertyT("display"), out var __jsonDisplay) ? Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.Display.FromJson(__jsonDisplay) : Display;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_isDataAction = If( json?.PropertyT("isDataAction"), out var __jsonIsDataAction) ? (bool?)__jsonIsDataAction : IsDataAction;} + {_display = If( json?.PropertyT("display"), out var __jsonDisplay) ? Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Display.FromJson(__jsonDisplay) : _display;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_isDataAction = If( json?.PropertyT("isDataAction"), out var __jsonIsDataAction) ? (bool?)__jsonIsDataAction : _isDataAction;} AfterFromJson(json); } @@ -103,11 +101,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode ToJson return container; } AddIf( null != this._display ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) this._display.ToJson(null,serializationMode) : null, "display" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._isDataAction ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonBoolean((bool)this._isDataAction) : null, "isDataAction" ,container.Add ); } diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/OperationList.PowerShell.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/OperationList.PowerShell.cs similarity index 80% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/OperationList.PowerShell.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/OperationList.PowerShell.cs index e2b185d50af7..0b6c9776edc2 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/OperationList.PowerShell.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/OperationList.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.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class OperationList 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.BareMetal.Models.Api20210809.IOperationList DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperationList DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new OperationList(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.BareMetal.Models.Api20210809.IOperationList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperationList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new OperationList(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IO /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperationList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -111,13 +111,13 @@ internal OperationList(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperation[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.OperationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperationListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperationListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.OperationTypeConverter.ConvertFrom)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -132,7 +132,7 @@ internal OperationList(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperation[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.OperationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperationListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperationListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.OperationTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/OperationList.TypeConverter.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/OperationList.TypeConverter.cs similarity index 97% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/OperationList.TypeConverter.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/OperationList.TypeConverter.cs index 2f3e23040447..b58c7b2aafbe 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/OperationList.TypeConverter.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/OperationList.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.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Models.Api20210809.IOperationList ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperationList ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationList).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperationList).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/OperationList.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/OperationList.cs similarity index 65% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/OperationList.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/OperationList.cs index 4b13aa34221b..750f141497c5 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/OperationList.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/OperationList.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.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions; /// List of AzureBareMetal operations public partial class OperationList : - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationList, - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationListInternal + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperationList, + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperationListInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperation[] _value; + private System.Collections.Generic.List _value; /// List of AzureBareMetal operations [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperation[] 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 OperationList() @@ -34,10 +34,13 @@ public partial interface IOperationList : [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"List of AzureBareMetal operations", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperation) })] - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperation[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperation) })] + System.Collections.Generic.List Value { get; set; } } /// List of AzureBareMetal operations @@ -45,7 +48,7 @@ internal partial interface IOperationListInternal { /// List of AzureBareMetal operations - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperation[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/OperationList.json.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/OperationList.json.cs similarity index 90% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/OperationList.json.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/OperationList.json.cs index c985ea9028fa..6c1d54abcb4f 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/OperationList.json.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/OperationList.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.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class OperationList partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationList. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperationList. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationList. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperationList. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationList FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperationList FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json ? new OperationList(json) : null; } @@ -77,7 +77,7 @@ internal OperationList(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Models.Api20210809.IOperation) (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.Operation.FromJson(__u) )) ))() : null : Value;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Models.IOperation) (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Operation.FromJson(__u) )) ))() : null : _value;} AfterFromJson(json); } diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api10/Resource.PowerShell.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Resource.PowerShell.cs similarity index 80% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api10/Resource.PowerShell.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/Resource.PowerShell.cs index 964811f5a033..cac3c9ea36d9 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api10/Resource.PowerShell.cs +++ b/generated/BareMetal/BareMetal.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.BareMetal.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Models.Api10.IResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Models.Api10.IResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new Resource(content); } @@ -95,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourc /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api10/Resource.TypeConverter.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Resource.TypeConverter.cs similarity index 97% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api10/Resource.TypeConverter.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/Resource.TypeConverter.cs index 68c5e5014196..dd6e0933cd2f 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api10/Resource.TypeConverter.cs +++ b/generated/BareMetal/BareMetal.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.BareMetal.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Models.Api10.IResource ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResource ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResource).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResource).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api10/Resource.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Resource.cs similarity index 88% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api10/Resource.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/Resource.cs index bc831a72b326..44d2311f378c 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api10/Resource.cs +++ b/generated/BareMetal/BareMetal.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.BareMetal.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions; @@ -11,8 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10 /// Common fields that are returned in the response for all Azure Resource Manager resources /// public partial class Resource : - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResource, - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResource, + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Models.Api10.IResourceInternal.Id { get => this._id; set { {_id = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResourceInternal.Id { get => this._id; set { {_id = value;} } } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResourceInternal.Name { get => this._name; set { {_name = value;} } } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal.Type { get => this._type; set { {_type = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.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.BareMetal.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.BareMetal.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/BareMetal/BareMetal.Autorest/generated/api/Models/Api10/Resource.json.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Resource.json.cs similarity index 91% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api10/Resource.json.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/Resource.json.cs index 88a44b13fec1..d03395444636 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api10/Resource.json.cs +++ b/generated/BareMetal/BareMetal.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.BareMetal.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions; @@ -56,13 +56,11 @@ public partial class Resource partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResource. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResource. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResource. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResource. + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json ? new Resource(json) : null; } @@ -79,9 +77,9 @@ internal Resource(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.Json { 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 +102,15 @@ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode ToJson { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); } diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Result.PowerShell.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Result.PowerShell.cs similarity index 85% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Result.PowerShell.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/Result.PowerShell.cs index 866a3c8a31e0..c3441d123f94 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Result.PowerShell.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Result.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.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class Result 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.BareMetal.Models.Api20210809.IResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResult DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new Result(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.BareMetal.Models.Api20210809.IResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new Result(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IR /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -111,13 +111,13 @@ internal Result(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("SampleProperty")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IResultInternal)this).SampleProperty = (string) content.GetValueForProperty("SampleProperty",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IResultInternal)this).SampleProperty, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResultInternal)this).SampleProperty = (string) content.GetValueForProperty("SampleProperty",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResultInternal)this).SampleProperty, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -132,7 +132,7 @@ internal Result(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("SampleProperty")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IResultInternal)this).SampleProperty = (string) content.GetValueForProperty("SampleProperty",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IResultInternal)this).SampleProperty, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResultInternal)this).SampleProperty = (string) content.GetValueForProperty("SampleProperty",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResultInternal)this).SampleProperty, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Result.TypeConverter.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Result.TypeConverter.cs similarity index 97% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Result.TypeConverter.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/Result.TypeConverter.cs index 07f49e79f547..78eaf6fb3c3b 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Result.TypeConverter.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Result.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.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Models.Api20210809.IResult ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResult ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IResult).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResult).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Result.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Result.cs similarity index 86% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Result.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/Result.cs index 57b6961572cb..376f521230b7 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Result.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Result.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.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions; /// Sample result definition public partial class Result : - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IResult, - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IResultInternal + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResult, + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResultInternal { /// Backing field for property. @@ -34,6 +34,9 @@ public partial interface IResult : [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Sample property of type string", SerializedName = @"sampleProperty", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Result.json.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Result.json.cs similarity index 93% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Result.json.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/Result.json.cs index a44086b947f5..990bbc901060 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Result.json.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Result.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.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions; @@ -54,13 +54,11 @@ public partial class Result partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IResult. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResult. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IResult. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResult. + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json ? new Result(json) : null; } @@ -77,7 +75,7 @@ internal Result(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonOb { return; } - {_sampleProperty = If( json?.PropertyT("sampleProperty"), out var __jsonSampleProperty) ? (string)__jsonSampleProperty : (string)SampleProperty;} + {_sampleProperty = If( json?.PropertyT("sampleProperty"), out var __jsonSampleProperty) ? (string)__jsonSampleProperty : (string)_sampleProperty;} AfterFromJson(json); } diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/StorageProfile.PowerShell.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/StorageProfile.PowerShell.cs similarity index 77% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/StorageProfile.PowerShell.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/StorageProfile.PowerShell.cs index 17aa00cbbced..e04aec0ebe3d 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/StorageProfile.PowerShell.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/StorageProfile.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.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class StorageProfile 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.BareMetal.Models.Api20210809.IStorageProfile DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IStorageProfile DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new StorageProfile(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.BareMetal.Models.Api20210809.IStorageProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IStorageProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new StorageProfile(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IS /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IStorageProfile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IStorageProfile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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 StorageProfile(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("NfsIPAddress")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IStorageProfileInternal)this).NfsIPAddress = (string) content.GetValueForProperty("NfsIPAddress",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IStorageProfileInternal)this).NfsIPAddress, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IStorageProfileInternal)this).NfsIPAddress = (string) content.GetValueForProperty("NfsIPAddress",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IStorageProfileInternal)this).NfsIPAddress, global::System.Convert.ToString); } if (content.Contains("OSDisk")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IStorageProfileInternal)this).OSDisk = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisk[]) content.GetValueForProperty("OSDisk",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IStorageProfileInternal)this).OSDisk, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.DiskTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IStorageProfileInternal)this).OSDisk = (System.Collections.Generic.List) content.GetValueForProperty("OSDisk",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IStorageProfileInternal)this).OSDisk, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.DiskTypeConverter.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. @@ -136,11 +136,11 @@ internal StorageProfile(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("NfsIPAddress")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IStorageProfileInternal)this).NfsIPAddress = (string) content.GetValueForProperty("NfsIPAddress",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IStorageProfileInternal)this).NfsIPAddress, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IStorageProfileInternal)this).NfsIPAddress = (string) content.GetValueForProperty("NfsIPAddress",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IStorageProfileInternal)this).NfsIPAddress, global::System.Convert.ToString); } if (content.Contains("OSDisk")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IStorageProfileInternal)this).OSDisk = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisk[]) content.GetValueForProperty("OSDisk",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IStorageProfileInternal)this).OSDisk, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.DiskTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IStorageProfileInternal)this).OSDisk = (System.Collections.Generic.List) content.GetValueForProperty("OSDisk",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IStorageProfileInternal)this).OSDisk, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.DiskTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/StorageProfile.TypeConverter.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/StorageProfile.TypeConverter.cs similarity index 97% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/StorageProfile.TypeConverter.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/StorageProfile.TypeConverter.cs index 14f458e45844..1c217c69af0a 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/StorageProfile.TypeConverter.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/StorageProfile.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.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Models.Api20210809.IStorageProfile ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IStorageProfile ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IStorageProfile).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IStorageProfile).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/StorageProfile.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/StorageProfile.cs similarity index 74% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/StorageProfile.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/StorageProfile.cs index 305b7ea19fd2..bb2109a6c5af 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/StorageProfile.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/StorageProfile.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.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions; /// Specifies the storage settings for the AzureBareMetal instance disks. public partial class StorageProfile : - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IStorageProfile, - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IStorageProfileInternal + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IStorageProfile, + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IStorageProfileInternal { /// Internal Acessors for NfsIPAddress - string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IStorageProfileInternal.NfsIPAddress { get => this._nfsIPAddress; set { {_nfsIPAddress = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IStorageProfileInternal.NfsIPAddress { get => this._nfsIPAddress; set { {_nfsIPAddress = value;} } } /// Backing field for property. private string _nfsIPAddress; @@ -24,13 +24,13 @@ public partial class StorageProfile : public string NfsIPAddress { get => this._nfsIPAddress; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisk[] _oSDisk; + private System.Collections.Generic.List _oSDisk; /// /// Specifies information about the operating system disk used by baremetal instance. /// [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisk[] OSDisk { get => this._oSDisk; set => this._oSDisk = value; } + public System.Collections.Generic.List OSDisk { get => this._oSDisk; set => this._oSDisk = value; } /// Creates an new instance. public StorageProfile() @@ -46,6 +46,9 @@ public partial interface IStorageProfile : [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"IP Address to connect to storage.", SerializedName = @"nfsIpAddress", PossibleTypes = new [] { typeof(string) })] @@ -56,10 +59,13 @@ public partial interface IStorageProfile : [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Specifies information about the operating system disk used by baremetal instance.", SerializedName = @"osDisks", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisk) })] - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisk[] OSDisk { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IDisk) })] + System.Collections.Generic.List OSDisk { get; set; } } /// Specifies the storage settings for the AzureBareMetal instance disks. @@ -71,7 +77,7 @@ internal partial interface IStorageProfileInternal /// /// Specifies information about the operating system disk used by baremetal instance. /// - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisk[] OSDisk { get; set; } + System.Collections.Generic.List OSDisk { get; set; } } } \ No newline at end of file diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/StorageProfile.json.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/StorageProfile.json.cs similarity index 90% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/StorageProfile.json.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/StorageProfile.json.cs index 242bc20ef3dc..ec885e748824 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/StorageProfile.json.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/StorageProfile.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.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class StorageProfile partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IStorageProfile. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IStorageProfile. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IStorageProfile. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IStorageProfile. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IStorageProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IStorageProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json ? new StorageProfile(json) : null; } @@ -77,8 +77,8 @@ internal StorageProfile(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Jso { return; } - {_nfsIPAddress = If( json?.PropertyT("nfsIpAddress"), out var __jsonNfsIPAddress) ? (string)__jsonNfsIPAddress : (string)NfsIPAddress;} - {_oSDisk = If( json?.PropertyT("osDisks"), out var __jsonOSDisks) ? If( __jsonOSDisks as Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Models.Api20210809.IDisk) (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.Disk.FromJson(__u) )) ))() : null : OSDisk;} + {_nfsIPAddress = If( json?.PropertyT("nfsIpAddress"), out var __jsonNfsIPAddress) ? (string)__jsonNfsIPAddress : (string)_nfsIPAddress;} + {_oSDisk = If( json?.PropertyT("osDisks"), out var __jsonOSDisks) ? If( __jsonOSDisks as Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Models.IDisk) (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Disk.FromJson(__u) )) ))() : null : _oSDisk;} AfterFromJson(json); } @@ -101,7 +101,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode ToJson { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._nfsIPAddress)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._nfsIPAddress.ToString()) : null, "nfsIpAddress" ,container.Add ); } diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api10/SystemData.PowerShell.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/SystemData.PowerShell.cs similarity index 66% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api10/SystemData.PowerShell.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/SystemData.PowerShell.cs index d08de866a525..3c11a5f530c4 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api10/SystemData.PowerShell.cs +++ b/generated/BareMetal/BareMetal.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.BareMetal.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Models.Api10.ISystemData DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Models.Api10.ISystemData DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ISystemData DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new SystemData(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemD /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemData FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ISystemData FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Models.Api10.ISystemDataInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal)this).CreatedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ISystemDataInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ISystemDataInternal)this).CreatedBy, global::System.Convert.ToString); } if (content.Contains("CreatedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal)this).CreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.CreatedByType?) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal)this).CreatedByType, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ISystemDataInternal)this).CreatedByType = (string) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ISystemDataInternal)this).CreatedByType, global::System.Convert.ToString); } if (content.Contains("CreatedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.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.BareMetal.Models.ISystemDataInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Models.Api10.ISystemDataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal)this).LastModifiedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ISystemDataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ISystemDataInternal)this).LastModifiedBy, global::System.Convert.ToString); } if (content.Contains("LastModifiedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal)this).LastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.CreatedByType?) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal)this).LastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ISystemDataInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ISystemDataInternal)this).LastModifiedByType, global::System.Convert.ToString); } if (content.Contains("LastModifiedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.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.BareMetal.Models.ISystemDataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Models.Api10.ISystemDataInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal)this).CreatedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ISystemDataInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ISystemDataInternal)this).CreatedBy, global::System.Convert.ToString); } if (content.Contains("CreatedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal)this).CreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.CreatedByType?) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal)this).CreatedByType, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ISystemDataInternal)this).CreatedByType = (string) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ISystemDataInternal)this).CreatedByType, global::System.Convert.ToString); } if (content.Contains("CreatedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.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.BareMetal.Models.ISystemDataInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Models.Api10.ISystemDataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal)this).LastModifiedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ISystemDataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ISystemDataInternal)this).LastModifiedBy, global::System.Convert.ToString); } if (content.Contains("LastModifiedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal)this).LastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.CreatedByType?) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal)this).LastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ISystemDataInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ISystemDataInternal)this).LastModifiedByType, global::System.Convert.ToString); } if (content.Contains("LastModifiedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.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.BareMetal.Models.ISystemDataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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/BareMetal/BareMetal.Autorest/generated/api/Models/Api10/SystemData.TypeConverter.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/SystemData.TypeConverter.cs similarity index 97% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api10/SystemData.TypeConverter.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/SystemData.TypeConverter.cs index 1819e8f31a4e..6e634cf73a26 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api10/SystemData.TypeConverter.cs +++ b/generated/BareMetal/BareMetal.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.BareMetal.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Models.Api10.ISystemData ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ISystemData ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemData).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ISystemData).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api10/SystemData.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/SystemData.cs similarity index 78% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api10/SystemData.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/SystemData.cs index 3165343926ad..4b67eec3b794 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api10/SystemData.cs +++ b/generated/BareMetal/BareMetal.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.BareMetal.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions; /// Metadata pertaining to creation and last modification of the resource. public partial class SystemData : - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemData, - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ISystemData, + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Support.CreatedByType? _createdByType; + private string _createdByType; /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Support.CreatedByType? _lastModifiedByType; + private string _lastModifiedByType; /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.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.BareMetal.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.BareMetal.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.BareMetal.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.CreatedByType? CreatedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string CreatedByType { get; set; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.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.BareMetal.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.BareMetal.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.CreatedByType? LastModifiedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Support.CreatedByType? CreatedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Support.CreatedByType? LastModifiedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string LastModifiedByType { get; set; } } } \ No newline at end of file diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api10/SystemData.json.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/SystemData.json.cs similarity index 93% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api10/SystemData.json.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/SystemData.json.cs index f80c6cd7a6b1..3a6ea292fc67 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api10/SystemData.json.cs +++ b/generated/BareMetal/BareMetal.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.BareMetal.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions; @@ -54,13 +54,11 @@ public partial class SystemData partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemData. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ISystemData. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemData. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemData FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ISystemData. + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ISystemData FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json ? new SystemData(json) : null; } @@ -77,12 +75,12 @@ internal SystemData(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.Js { 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/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Tags.PowerShell.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Tags.PowerShell.cs similarity index 90% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Tags.PowerShell.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/Tags.PowerShell.cs index 3cf7fb3308d8..affbd4754671 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Tags.PowerShell.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Tags.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.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class Tags 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.BareMetal.Models.Api20210809.ITags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITags DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new Tags(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.BareMetal.Models.Api20210809.ITags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new Tags(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IT /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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,7 +115,7 @@ internal Tags(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/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Tags.TypeConverter.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Tags.TypeConverter.cs similarity index 97% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Tags.TypeConverter.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/Tags.TypeConverter.cs index 3eb0c1749cf2..9a9a9879def3 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Tags.TypeConverter.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Tags.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.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Models.Api20210809.ITags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITags).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Tags.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Tags.cs similarity index 80% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Tags.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/Tags.cs index 1cf5b9c7b8aa..fb7a113a6f9c 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Tags.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Tags.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.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions; /// Tags field of the AzureBareMetal instance. public partial class Tags : - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags, - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITagsInternal + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITags, + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITagsInternal { /// Creates an new instance. diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Tags.dictionary.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Tags.dictionary.cs similarity index 95% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Tags.dictionary.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/Tags.dictionary.cs index 88058f7ad21d..1e9955faaf61 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Tags.dictionary.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Tags.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.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Models.Api20210809.Tags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Tags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Tags.json.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Tags.json.cs similarity index 94% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Tags.json.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/Tags.json.cs index dfc157698ac7..97302435c9a5 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Tags.json.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Tags.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.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions; @@ -54,13 +54,11 @@ public partial class Tags partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITags. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITags. + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITags FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json ? new Tags(json) : null; } diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Tags1.PowerShell.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Tags1.PowerShell.cs similarity index 84% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Tags1.PowerShell.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/Tags1.PowerShell.cs index fcb7b0eaa739..5af8f9c12490 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Tags1.PowerShell.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Tags1.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.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class Tags1 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.BareMetal.Models.Api20210809.ITags1 DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITags1 DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new Tags1(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.BareMetal.Models.Api20210809.ITags1 DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITags1 DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new Tags1(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IT /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags1 FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITags1 FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -111,13 +111,13 @@ internal Tags1(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags1Internal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags1Internal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITags1Internal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITags1Internal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.TagsTypeConverter.ConvertFrom); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -132,7 +132,7 @@ internal Tags1(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags1Internal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags1Internal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITags1Internal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITags1Internal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.TagsTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Tags1.TypeConverter.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Tags1.TypeConverter.cs similarity index 97% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Tags1.TypeConverter.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/Tags1.TypeConverter.cs index 9880639d0a55..40856dd664f8 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Tags1.TypeConverter.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Tags1.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.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Models.Api20210809.ITags1 ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITags1 ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags1).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITags1).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Tags1.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Tags1.cs similarity index 72% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Tags1.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/Tags1.cs index cd1832d817d4..640a2fa7923c 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Tags1.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Tags1.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.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions; /// Tags field of the AzureBareMetal instance. public partial class Tags1 : - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags1, - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags1Internal + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITags1, + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITags1Internal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITags _tag; /// Tags field of the AzureBareMetal instance. [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.Tags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Tags()); set => this._tag = value; } /// Creates an new instance. public Tags1() @@ -34,10 +34,13 @@ public partial interface ITags1 : [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Tags field of the AzureBareMetal instance.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags) })] - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITags) })] + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITags Tag { get; set; } } /// Tags field of the AzureBareMetal instance. @@ -45,7 +48,7 @@ internal partial interface ITags1Internal { /// Tags field of the AzureBareMetal instance. - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITags Tag { get; set; } } } \ No newline at end of file diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Tags1.json.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Tags1.json.cs similarity index 93% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Tags1.json.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/Tags1.json.cs index f236bc4f0eac..1e4ea4647279 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api20210809/Tags1.json.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Tags1.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.BareMetal.Models.Api20210809 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions; @@ -54,13 +54,11 @@ public partial class Tags1 partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags1. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITags1. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags1. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags1 FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITags1. + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITags1 FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json ? new Tags1(json) : null; } @@ -77,7 +75,7 @@ internal Tags1(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObj { return; } - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.Tags.FromJson(__jsonTags) : Tag;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Tags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api10/TrackedResource.PowerShell.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/TrackedResource.PowerShell.cs similarity index 73% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api10/TrackedResource.PowerShell.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/TrackedResource.PowerShell.cs index fb2284619ae7..9d00abe7a64a 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api10/TrackedResource.PowerShell.cs +++ b/generated/BareMetal/BareMetal.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.BareMetal.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell; @@ -65,27 +65,27 @@ public partial class TrackedResource partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Models.Api10.ITrackedResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITrackedResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new TrackedResource(content); } @@ -95,7 +95,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITracked /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITrackedResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -115,7 +115,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -130,29 +130,29 @@ internal TrackedResource(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.TrackedResourceTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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. @@ -167,23 +167,23 @@ internal TrackedResource(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.TrackedResourceTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api10/TrackedResource.TypeConverter.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/TrackedResource.TypeConverter.cs similarity index 97% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api10/TrackedResource.TypeConverter.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/TrackedResource.TypeConverter.cs index 73dd4c6b1f06..e5246bd4123e 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api10/TrackedResource.TypeConverter.cs +++ b/generated/BareMetal/BareMetal.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.BareMetal.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Models.Api10.ITrackedResource ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITrackedResource ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResource).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITrackedResource).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api10/TrackedResource.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/TrackedResource.cs similarity index 72% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api10/TrackedResource.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/TrackedResource.cs index 33f2c7c42daf..7a9f54a9aed2 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api10/TrackedResource.cs +++ b/generated/BareMetal/BareMetal.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.BareMetal.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions; @@ -11,20 +11,20 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10 /// 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.BareMetal.Models.Api10.ITrackedResource, - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITrackedResource, + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITrackedResourceInternal, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.Resource(); + private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Resource(); /// /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)__resource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResourceInternal)__resource).Id; } /// Backing field for property. private string _location; @@ -34,30 +34,30 @@ public partial class TrackedResource : public string Location { get => this._location; set => this._location = value; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)__resource).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResourceInternal)__resource).Id = value; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)__resource).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResourceInternal)__resource).Name = value; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)__resource).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResourceInternal)__resource).Type = value; } /// The name of the resource [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)__resource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResourceInternal)__resource).Name; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceTags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITrackedResourceTags _tag; /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.TrackedResourceTags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITrackedResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.TrackedResourceTags()); set => this._tag = value; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" /// [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)__resource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResourceInternal)__resource).Type; } /// Creates an new instance. public TrackedResource() @@ -80,12 +80,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.BareMetal.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResource + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResource { /// The geo-location where the resource lives [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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) })] @@ -94,20 +97,23 @@ public partial interface ITrackedResource : [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceTags) })] - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceTags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITrackedResourceTags) })] + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Models.Api10.IResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IResourceInternal { /// The geo-location where the resource lives string Location { get; set; } /// Resource tags. - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceTags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITrackedResourceTags Tag { get; set; } } } \ No newline at end of file diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api10/TrackedResource.json.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/TrackedResource.json.cs similarity index 87% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api10/TrackedResource.json.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/TrackedResource.json.cs index ceb41067c17b..3eff2d7d14da 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api10/TrackedResource.json.cs +++ b/generated/BareMetal/BareMetal.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.BareMetal.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class TrackedResource partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResource. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITrackedResource. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResource. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITrackedResource. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITrackedResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json ? new TrackedResource(json) : null; } @@ -88,7 +88,10 @@ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode ToJson } __resource?.ToJson(container, serializationMode); AddIf( null != this._tag ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) this._tag.ToJson(null,serializationMode) : null, "tags" ,container.Add ); - AddIf( null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._location.ToString()) : null, "location" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.Js { return; } - __resource = new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.Resource(json); - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.TrackedResourceTags.FromJson(__jsonTags) : Tag;} - {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)Location;} + __resource = new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Resource(json); + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.TrackedResourceTags.FromJson(__jsonTags) : _tag;} + {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)_location;} AfterFromJson(json); } } diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api10/TrackedResourceTags.PowerShell.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/TrackedResourceTags.PowerShell.cs similarity index 90% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api10/TrackedResourceTags.PowerShell.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/TrackedResourceTags.PowerShell.cs index cff1d36b3063..6596af18ce39 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api10/TrackedResourceTags.PowerShell.cs +++ b/generated/BareMetal/BareMetal.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.BareMetal.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell; @@ -63,27 +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.BareMetal.Models.Api10.ITrackedResourceTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Models.Api10.ITrackedResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITrackedResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new TrackedResourceTags(content); } @@ -93,7 +93,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITracked /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITrackedResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -113,7 +113,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -132,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/BareMetal/BareMetal.Autorest/generated/api/Models/Api10/TrackedResourceTags.TypeConverter.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/TrackedResourceTags.TypeConverter.cs similarity index 97% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api10/TrackedResourceTags.TypeConverter.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/TrackedResourceTags.TypeConverter.cs index d2f97545223b..cb1edba61ea7 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api10/TrackedResourceTags.TypeConverter.cs +++ b/generated/BareMetal/BareMetal.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.BareMetal.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Models.Api10.ITrackedResourceTags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITrackedResourceTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceTags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITrackedResourceTags).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api10/TrackedResourceTags.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/TrackedResourceTags.cs similarity index 79% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api10/TrackedResourceTags.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/TrackedResourceTags.cs index 967d3f92dc7a..c0c39315ece5 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api10/TrackedResourceTags.cs +++ b/generated/BareMetal/BareMetal.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.BareMetal.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions; /// Resource tags. public partial class TrackedResourceTags : - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceTags, - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceTagsInternal + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITrackedResourceTags, + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITrackedResourceTagsInternal { /// Creates an new instance. diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api10/TrackedResourceTags.dictionary.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/TrackedResourceTags.dictionary.cs similarity index 95% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api10/TrackedResourceTags.dictionary.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/TrackedResourceTags.dictionary.cs index 46e822af2ba8..27a2ff5580ce 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api10/TrackedResourceTags.dictionary.cs +++ b/generated/BareMetal/BareMetal.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.BareMetal.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Models.Api10.TrackedResourceTags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.TrackedResourceTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api10/TrackedResourceTags.json.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Models/TrackedResourceTags.json.cs similarity index 95% rename from generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api10/TrackedResourceTags.json.cs rename to generated/BareMetal/BareMetal.Autorest/generated/api/Models/TrackedResourceTags.json.cs index 06b279d46cbe..efd5a78c1286 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Models/Api10/TrackedResourceTags.json.cs +++ b/generated/BareMetal/BareMetal.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.BareMetal.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class TrackedResourceTags partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceTags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITrackedResourceTags. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceTags. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITrackedResourceTags. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITrackedResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json ? new TrackedResourceTags(json) : null; } diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Support/AzureBareMetalHardwareTypeNamesEnum.Completer.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Support/AzureBareMetalHardwareTypeNamesEnum.Completer.cs deleted file mode 100644 index 708b2f2e1db8..000000000000 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Support/AzureBareMetalHardwareTypeNamesEnum.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.BareMetal.Support -{ - - /// Name of the hardware type (vendor and/or their product name) - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnumTypeConverter))] - public partial struct AzureBareMetalHardwareTypeNamesEnum : - 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) || "Cisco_UCS".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Cisco_UCS'", "Cisco_UCS", global::System.Management.Automation.CompletionResultType.ParameterValue, "Cisco_UCS"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "HPE".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'HPE'", "HPE", global::System.Management.Automation.CompletionResultType.ParameterValue, "HPE"); - } - } - } -} \ No newline at end of file diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Support/AzureBareMetalHardwareTypeNamesEnum.TypeConverter.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Support/AzureBareMetalHardwareTypeNamesEnum.TypeConverter.cs deleted file mode 100644 index efabad214f27..000000000000 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Support/AzureBareMetalHardwareTypeNamesEnum.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.BareMetal.Support -{ - - /// Name of the hardware type (vendor and/or their product name) - public partial class AzureBareMetalHardwareTypeNamesEnumTypeConverter : - 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) => AzureBareMetalHardwareTypeNamesEnum.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/BareMetal/BareMetal.Autorest/generated/api/Support/AzureBareMetalHardwareTypeNamesEnum.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Support/AzureBareMetalHardwareTypeNamesEnum.cs deleted file mode 100644 index e6e5c9678cf1..000000000000 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Support/AzureBareMetalHardwareTypeNamesEnum.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.BareMetal.Support -{ - - /// Name of the hardware type (vendor and/or their product name) - public partial struct AzureBareMetalHardwareTypeNamesEnum : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum CiscoUcs = @"Cisco_UCS"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum Hpe = @"HPE"; - - /// - /// 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 AzureBareMetalHardwareTypeNamesEnum(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to AzureBareMetalHardwareTypeNamesEnum - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new AzureBareMetalHardwareTypeNamesEnum(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type AzureBareMetalHardwareTypeNamesEnum - /// 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.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type AzureBareMetalHardwareTypeNamesEnum (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 AzureBareMetalHardwareTypeNamesEnum && Equals((AzureBareMetalHardwareTypeNamesEnum)obj); - } - - /// Returns hashCode for enum AzureBareMetalHardwareTypeNamesEnum - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for AzureBareMetalHardwareTypeNamesEnum - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to AzureBareMetalHardwareTypeNamesEnum - /// the value to convert to an instance of . - - public static implicit operator AzureBareMetalHardwareTypeNamesEnum(string value) - { - return new AzureBareMetalHardwareTypeNamesEnum(value); - } - - /// Implicit operator to convert AzureBareMetalHardwareTypeNamesEnum to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum e) - { - return e._value; - } - - /// Overriding != operator for enum AzureBareMetalHardwareTypeNamesEnum - /// 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.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum e1, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum AzureBareMetalHardwareTypeNamesEnum - /// 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.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum e1, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Support/AzureBareMetalInstancePowerStateEnum.Completer.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Support/AzureBareMetalInstancePowerStateEnum.Completer.cs deleted file mode 100644 index 204c4318224a..000000000000 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Support/AzureBareMetalInstancePowerStateEnum.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.BareMetal.Support -{ - - /// Resource power state - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstancePowerStateEnumTypeConverter))] - public partial struct AzureBareMetalInstancePowerStateEnum : - 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) || "starting".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'starting'", "starting", global::System.Management.Automation.CompletionResultType.ParameterValue, "starting"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "started".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'started'", "started", global::System.Management.Automation.CompletionResultType.ParameterValue, "started"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "stopping".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'stopping'", "stopping", global::System.Management.Automation.CompletionResultType.ParameterValue, "stopping"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "stopped".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'stopped'", "stopped", global::System.Management.Automation.CompletionResultType.ParameterValue, "stopped"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "restarting".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'restarting'", "restarting", global::System.Management.Automation.CompletionResultType.ParameterValue, "restarting"); - } - 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"); - } - } - } -} \ No newline at end of file diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Support/AzureBareMetalInstancePowerStateEnum.TypeConverter.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Support/AzureBareMetalInstancePowerStateEnum.TypeConverter.cs deleted file mode 100644 index 98a7725b06d9..000000000000 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Support/AzureBareMetalInstancePowerStateEnum.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.BareMetal.Support -{ - - /// Resource power state - public partial class AzureBareMetalInstancePowerStateEnumTypeConverter : - 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) => AzureBareMetalInstancePowerStateEnum.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/BareMetal/BareMetal.Autorest/generated/api/Support/AzureBareMetalInstancePowerStateEnum.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Support/AzureBareMetalInstancePowerStateEnum.cs deleted file mode 100644 index 13fc9818fea2..000000000000 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Support/AzureBareMetalInstancePowerStateEnum.cs +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support -{ - - /// Resource power state - public partial struct AzureBareMetalInstancePowerStateEnum : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstancePowerStateEnum Restarting = @"restarting"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstancePowerStateEnum Started = @"started"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstancePowerStateEnum Starting = @"starting"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstancePowerStateEnum Stopped = @"stopped"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstancePowerStateEnum Stopping = @"stopping"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstancePowerStateEnum Unknown = @"unknown"; - - /// - /// 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 AzureBareMetalInstancePowerStateEnum(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to AzureBareMetalInstancePowerStateEnum - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new AzureBareMetalInstancePowerStateEnum(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type AzureBareMetalInstancePowerStateEnum - /// 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.BareMetal.Support.AzureBareMetalInstancePowerStateEnum e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type AzureBareMetalInstancePowerStateEnum (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 AzureBareMetalInstancePowerStateEnum && Equals((AzureBareMetalInstancePowerStateEnum)obj); - } - - /// Returns hashCode for enum AzureBareMetalInstancePowerStateEnum - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for AzureBareMetalInstancePowerStateEnum - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to AzureBareMetalInstancePowerStateEnum - /// the value to convert to an instance of . - - public static implicit operator AzureBareMetalInstancePowerStateEnum(string value) - { - return new AzureBareMetalInstancePowerStateEnum(value); - } - - /// Implicit operator to convert AzureBareMetalInstancePowerStateEnum to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstancePowerStateEnum e) - { - return e._value; - } - - /// Overriding != operator for enum AzureBareMetalInstancePowerStateEnum - /// 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.BareMetal.Support.AzureBareMetalInstancePowerStateEnum e1, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstancePowerStateEnum e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum AzureBareMetalInstancePowerStateEnum - /// 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.BareMetal.Support.AzureBareMetalInstancePowerStateEnum e1, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstancePowerStateEnum e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Support/AzureBareMetalInstanceSizeNamesEnum.Completer.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Support/AzureBareMetalInstanceSizeNamesEnum.Completer.cs deleted file mode 100644 index fff400cedc66..000000000000 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Support/AzureBareMetalInstanceSizeNamesEnum.Completer.cs +++ /dev/null @@ -1,203 +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.BareMetal.Support -{ - - /// Specifies the AzureBareMetal instance SKU. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnumTypeConverter))] - public partial struct AzureBareMetalInstanceSizeNamesEnum : - 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) || "S72m".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'S72m'", "S72m", global::System.Management.Automation.CompletionResultType.ParameterValue, "S72m"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "S144m".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'S144m'", "S144m", global::System.Management.Automation.CompletionResultType.ParameterValue, "S144m"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "S72".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'S72'", "S72", global::System.Management.Automation.CompletionResultType.ParameterValue, "S72"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "S144".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'S144'", "S144", global::System.Management.Automation.CompletionResultType.ParameterValue, "S144"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "S192".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'S192'", "S192", global::System.Management.Automation.CompletionResultType.ParameterValue, "S192"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "S192m".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'S192m'", "S192m", global::System.Management.Automation.CompletionResultType.ParameterValue, "S192m"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "S192xm".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'S192xm'", "S192xm", global::System.Management.Automation.CompletionResultType.ParameterValue, "S192xm"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "S96".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'S96'", "S96", global::System.Management.Automation.CompletionResultType.ParameterValue, "S96"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "S112".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'S112'", "S112", global::System.Management.Automation.CompletionResultType.ParameterValue, "S112"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "S224".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'S224'", "S224", global::System.Management.Automation.CompletionResultType.ParameterValue, "S224"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "S224m".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'S224m'", "S224m", global::System.Management.Automation.CompletionResultType.ParameterValue, "S224m"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "S224om".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'S224om'", "S224om", global::System.Management.Automation.CompletionResultType.ParameterValue, "S224om"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "S224oo".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'S224oo'", "S224oo", global::System.Management.Automation.CompletionResultType.ParameterValue, "S224oo"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "S224oom".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'S224oom'", "S224oom", global::System.Management.Automation.CompletionResultType.ParameterValue, "S224oom"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "S224ooo".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'S224ooo'", "S224ooo", global::System.Management.Automation.CompletionResultType.ParameterValue, "S224ooo"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "S384".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'S384'", "S384", global::System.Management.Automation.CompletionResultType.ParameterValue, "S384"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "S384m".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'S384m'", "S384m", global::System.Management.Automation.CompletionResultType.ParameterValue, "S384m"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "S384xm".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'S384xm'", "S384xm", global::System.Management.Automation.CompletionResultType.ParameterValue, "S384xm"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "S384xxm".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'S384xxm'", "S384xxm", global::System.Management.Automation.CompletionResultType.ParameterValue, "S384xxm"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "S448".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'S448'", "S448", global::System.Management.Automation.CompletionResultType.ParameterValue, "S448"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "S448m".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'S448m'", "S448m", global::System.Management.Automation.CompletionResultType.ParameterValue, "S448m"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "S448om".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'S448om'", "S448om", global::System.Management.Automation.CompletionResultType.ParameterValue, "S448om"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "S448oo".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'S448oo'", "S448oo", global::System.Management.Automation.CompletionResultType.ParameterValue, "S448oo"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "S448oom".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'S448oom'", "S448oom", global::System.Management.Automation.CompletionResultType.ParameterValue, "S448oom"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "S448ooo".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'S448ooo'", "S448ooo", global::System.Management.Automation.CompletionResultType.ParameterValue, "S448ooo"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "S576m".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'S576m'", "S576m", global::System.Management.Automation.CompletionResultType.ParameterValue, "S576m"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "S576xm".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'S576xm'", "S576xm", global::System.Management.Automation.CompletionResultType.ParameterValue, "S576xm"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "S672".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'S672'", "S672", global::System.Management.Automation.CompletionResultType.ParameterValue, "S672"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "S672m".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'S672m'", "S672m", global::System.Management.Automation.CompletionResultType.ParameterValue, "S672m"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "S672om".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'S672om'", "S672om", global::System.Management.Automation.CompletionResultType.ParameterValue, "S672om"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "S672oo".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'S672oo'", "S672oo", global::System.Management.Automation.CompletionResultType.ParameterValue, "S672oo"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "S672oom".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'S672oom'", "S672oom", global::System.Management.Automation.CompletionResultType.ParameterValue, "S672oom"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "S672ooo".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'S672ooo'", "S672ooo", global::System.Management.Automation.CompletionResultType.ParameterValue, "S672ooo"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "S768".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'S768'", "S768", global::System.Management.Automation.CompletionResultType.ParameterValue, "S768"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "S768m".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'S768m'", "S768m", global::System.Management.Automation.CompletionResultType.ParameterValue, "S768m"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "S768xm".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'S768xm'", "S768xm", global::System.Management.Automation.CompletionResultType.ParameterValue, "S768xm"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "S896".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'S896'", "S896", global::System.Management.Automation.CompletionResultType.ParameterValue, "S896"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "S896m".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'S896m'", "S896m", global::System.Management.Automation.CompletionResultType.ParameterValue, "S896m"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "S896om".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'S896om'", "S896om", global::System.Management.Automation.CompletionResultType.ParameterValue, "S896om"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "S896oo".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'S896oo'", "S896oo", global::System.Management.Automation.CompletionResultType.ParameterValue, "S896oo"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "S896oom".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'S896oom'", "S896oom", global::System.Management.Automation.CompletionResultType.ParameterValue, "S896oom"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "S896ooo".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'S896ooo'", "S896ooo", global::System.Management.Automation.CompletionResultType.ParameterValue, "S896ooo"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "S960m".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'S960m'", "S960m", global::System.Management.Automation.CompletionResultType.ParameterValue, "S960m"); - } - } - } -} \ No newline at end of file diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Support/AzureBareMetalInstanceSizeNamesEnum.TypeConverter.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Support/AzureBareMetalInstanceSizeNamesEnum.TypeConverter.cs deleted file mode 100644 index 5ca4a2569426..000000000000 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Support/AzureBareMetalInstanceSizeNamesEnum.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.BareMetal.Support -{ - - /// Specifies the AzureBareMetal instance SKU. - public partial class AzureBareMetalInstanceSizeNamesEnumTypeConverter : - 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) => AzureBareMetalInstanceSizeNamesEnum.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/BareMetal/BareMetal.Autorest/generated/api/Support/AzureBareMetalInstanceSizeNamesEnum.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Support/AzureBareMetalInstanceSizeNamesEnum.cs deleted file mode 100644 index 440b567377c1..000000000000 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Support/AzureBareMetalInstanceSizeNamesEnum.cs +++ /dev/null @@ -1,186 +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.BareMetal.Support -{ - - /// Specifies the AzureBareMetal instance SKU. - public partial struct AzureBareMetalInstanceSizeNamesEnum : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S112 = @"S112"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S144 = @"S144"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S144M = @"S144m"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S192 = @"S192"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S192M = @"S192m"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S192Xm = @"S192xm"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S224 = @"S224"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S224M = @"S224m"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S224Om = @"S224om"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S224Oo = @"S224oo"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S224Oom = @"S224oom"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S224Ooo = @"S224ooo"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S384 = @"S384"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S384M = @"S384m"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S384Xm = @"S384xm"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S384Xxm = @"S384xxm"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S448 = @"S448"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S448M = @"S448m"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S448Om = @"S448om"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S448Oo = @"S448oo"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S448Oom = @"S448oom"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S448Ooo = @"S448ooo"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S576M = @"S576m"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S576Xm = @"S576xm"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S672 = @"S672"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S672M = @"S672m"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S672Om = @"S672om"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S672Oo = @"S672oo"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S672Oom = @"S672oom"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S672Ooo = @"S672ooo"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S72 = @"S72"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S72M = @"S72m"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S768 = @"S768"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S768M = @"S768m"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S768Xm = @"S768xm"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S896 = @"S896"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S896M = @"S896m"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S896Om = @"S896om"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S896Oo = @"S896oo"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S896Oom = @"S896oom"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S896Ooo = @"S896ooo"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S96 = @"S96"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S960M = @"S960m"; - - /// - /// 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 AzureBareMetalInstanceSizeNamesEnum(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to AzureBareMetalInstanceSizeNamesEnum - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new AzureBareMetalInstanceSizeNamesEnum(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type AzureBareMetalInstanceSizeNamesEnum - /// 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.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type AzureBareMetalInstanceSizeNamesEnum (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 AzureBareMetalInstanceSizeNamesEnum && Equals((AzureBareMetalInstanceSizeNamesEnum)obj); - } - - /// Returns hashCode for enum AzureBareMetalInstanceSizeNamesEnum - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for AzureBareMetalInstanceSizeNamesEnum - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to AzureBareMetalInstanceSizeNamesEnum - /// the value to convert to an instance of . - - public static implicit operator AzureBareMetalInstanceSizeNamesEnum(string value) - { - return new AzureBareMetalInstanceSizeNamesEnum(value); - } - - /// Implicit operator to convert AzureBareMetalInstanceSizeNamesEnum to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum e) - { - return e._value; - } - - /// Overriding != operator for enum AzureBareMetalInstanceSizeNamesEnum - /// 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.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum e1, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum AzureBareMetalInstanceSizeNamesEnum - /// 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.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum e1, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Support/AzureBareMetalProvisioningStatesEnum.Completer.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Support/AzureBareMetalProvisioningStatesEnum.Completer.cs deleted file mode 100644 index 998726d59ac4..000000000000 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Support/AzureBareMetalProvisioningStatesEnum.Completer.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.BareMetal.Support -{ - - /// State of provisioning of the AzureBareMetalInstance - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalProvisioningStatesEnumTypeConverter))] - public partial struct AzureBareMetalProvisioningStatesEnum : - System.Management.Automation.IArgumentCompleter - { - - /// - /// Implementations of this function are called by PowerShell to complete arguments. - /// - /// The name of the command that needs argument completion. - /// The name of the parameter that needs argument completion. - /// The (possibly empty) word being completed. - /// The command ast in case it is needed for completion. - /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot - /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. - /// - /// A collection of completion results, most like with ResultType set to ParameterValue. - /// - public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) - { - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Accepted".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Accepted'", "Accepted", global::System.Management.Automation.CompletionResultType.ParameterValue, "Accepted"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Creating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Creating'", "Creating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Creating"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Updating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Updating'", "Updating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Updating"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "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) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Deleting".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Deleting'", "Deleting", global::System.Management.Automation.CompletionResultType.ParameterValue, "Deleting"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Migrating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Migrating'", "Migrating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Migrating"); - } - } - } -} \ No newline at end of file diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Support/AzureBareMetalProvisioningStatesEnum.TypeConverter.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Support/AzureBareMetalProvisioningStatesEnum.TypeConverter.cs deleted file mode 100644 index afdaba2942ff..000000000000 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Support/AzureBareMetalProvisioningStatesEnum.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.BareMetal.Support -{ - - /// State of provisioning of the AzureBareMetalInstance - public partial class AzureBareMetalProvisioningStatesEnumTypeConverter : - 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) => AzureBareMetalProvisioningStatesEnum.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/BareMetal/BareMetal.Autorest/generated/api/Support/AzureBareMetalProvisioningStatesEnum.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Support/AzureBareMetalProvisioningStatesEnum.cs deleted file mode 100644 index 2b48b855cd91..000000000000 --- a/generated/BareMetal/BareMetal.Autorest/generated/api/Support/AzureBareMetalProvisioningStatesEnum.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.BareMetal.Support -{ - - /// State of provisioning of the AzureBareMetalInstance - public partial struct AzureBareMetalProvisioningStatesEnum : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalProvisioningStatesEnum Accepted = @"Accepted"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalProvisioningStatesEnum Creating = @"Creating"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalProvisioningStatesEnum Deleting = @"Deleting"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalProvisioningStatesEnum Failed = @"Failed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalProvisioningStatesEnum Migrating = @"Migrating"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalProvisioningStatesEnum Succeeded = @"Succeeded"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalProvisioningStatesEnum Updating = @"Updating"; - - /// - /// 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 AzureBareMetalProvisioningStatesEnum(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to AzureBareMetalProvisioningStatesEnum - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new AzureBareMetalProvisioningStatesEnum(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type AzureBareMetalProvisioningStatesEnum - /// 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.BareMetal.Support.AzureBareMetalProvisioningStatesEnum e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type AzureBareMetalProvisioningStatesEnum (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 AzureBareMetalProvisioningStatesEnum && Equals((AzureBareMetalProvisioningStatesEnum)obj); - } - - /// Returns hashCode for enum AzureBareMetalProvisioningStatesEnum - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for AzureBareMetalProvisioningStatesEnum - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to AzureBareMetalProvisioningStatesEnum - /// the value to convert to an instance of . - - public static implicit operator AzureBareMetalProvisioningStatesEnum(string value) - { - return new AzureBareMetalProvisioningStatesEnum(value); - } - - /// Implicit operator to convert AzureBareMetalProvisioningStatesEnum to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalProvisioningStatesEnum e) - { - return e._value; - } - - /// Overriding != operator for enum AzureBareMetalProvisioningStatesEnum - /// 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.BareMetal.Support.AzureBareMetalProvisioningStatesEnum e1, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalProvisioningStatesEnum e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum AzureBareMetalProvisioningStatesEnum - /// 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.BareMetal.Support.AzureBareMetalProvisioningStatesEnum e1, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalProvisioningStatesEnum e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/BareMetal/BareMetal.Autorest/generated/api/Support/CreatedByType.Completer.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Support/CreatedByType.Completer.cs deleted file mode 100644 index b8365cd4d891..000000000000 --- a/generated/BareMetal/BareMetal.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.BareMetal.Support -{ - - /// The type of identity that created the resource. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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/BareMetal/BareMetal.Autorest/generated/api/Support/CreatedByType.TypeConverter.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Support/CreatedByType.TypeConverter.cs deleted file mode 100644 index 796a364851e8..000000000000 --- a/generated/BareMetal/BareMetal.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.BareMetal.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/BareMetal/BareMetal.Autorest/generated/api/Support/CreatedByType.cs b/generated/BareMetal/BareMetal.Autorest/generated/api/Support/CreatedByType.cs deleted file mode 100644 index 14ea6a0ec3df..000000000000 --- a/generated/BareMetal/BareMetal.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.BareMetal.Support -{ - - /// The type of identity that created the resource. - public partial struct CreatedByType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.CreatedByType Application = @"Application"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.CreatedByType Key = @"Key"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.CreatedByType ManagedIdentity = @"ManagedIdentity"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.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.BareMetal.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.BareMetal.Support.CreatedByType e1, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Support.CreatedByType e1, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.CreatedByType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/BareMetal/BareMetal.Autorest/generated/cmdlets/GetAzBareMetalOperation_List.cs b/generated/BareMetal/BareMetal.Autorest/generated/cmdlets/GetAzBareMetalOperation_List.cs index 0a649df927a8..bc73aca426aa 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/cmdlets/GetAzBareMetalOperation_List.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/cmdlets/GetAzBareMetalOperation_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Cmdlets; using System; /// Gets a list of AzureBareMetal management operations. @@ -14,12 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzBareMetalOperation_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperation))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperation))] [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Description(@"Gets a list of AzureBareMetal management operations.")] [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.HttpPath(Path = "/providers/Microsoft.BareMetalInfrastructure/operations", ApiVersion = "2021-08-09")] public partial class GetAzBareMetalOperation_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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 GetAzBareMetalOperation_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 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.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.BareMetal Client => Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Module.Instance.ClientAPI; @@ -53,6 +71,9 @@ public partial class GetAzBareMetalOperation_List : global::System.Management.Au [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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 GetAzBareMetalOperation_List : global::System.Management.Au /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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")] @@ -102,24 +123,24 @@ public partial class GetAzBareMetalOperation_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.BareMetal.Models.Api20210809.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Models.Api20210809.IOperationList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperationList /// 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) @@ -142,6 +163,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.BareMetal.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -163,7 +189,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzBareMetalOperation_List() { @@ -214,8 +240,33 @@ public GetAzBareMetalOperation_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.BareMetal.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.BareMetal.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -268,7 +319,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -286,7 +337,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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 } }); @@ -324,12 +375,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.BareMetal.Models.Api20210809.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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 ) { @@ -346,7 +397,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.BareMetal.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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 } @@ -364,12 +415,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.BareMetal.Models.Api20210809.IOperationList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperationList /// 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 ) { @@ -381,9 +432,33 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperationList + 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/BareMetal/BareMetal.Autorest/generated/cmdlets/GetAzBareMetal_Get.cs b/generated/BareMetal/BareMetal.Autorest/generated/cmdlets/GetAzBareMetal_Get.cs index c0a3d902db61..bdcf1887bd01 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/cmdlets/GetAzBareMetal_Get.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/cmdlets/GetAzBareMetal_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Cmdlets; using System; /// @@ -15,12 +17,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BareMetalInfrastructure/bareMetalInstances/{azureBareMetalInstanceName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzBareMetal_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstance))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstance))] [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Description(@"Gets an Azure BareMetal instance for the specified subscription, resource group, and instance name.")] [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BareMetalInfrastructure/bareMetalInstances/{azureBareMetalInstanceName}", ApiVersion = "2021-08-09")] public partial class GetAzBareMetal_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -36,11 +39,26 @@ public partial class GetAzBareMetal_Get : global::System.Management.Automation.P /// 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.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.BareMetal Client => Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Module.Instance.ClientAPI; @@ -54,6 +72,9 @@ public partial class GetAzBareMetal_Get : global::System.Management.Automation.P [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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 GetAzBareMetal_Get : global::System.Management.Automation.P /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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,7 +162,8 @@ public partial class GetAzBareMetal_Get : global::System.Management.Automation.P [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -150,24 +172,24 @@ public partial class GetAzBareMetal_Get : global::System.Management.Automation.P /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Models.Api20210809.IAzureBareMetalInstance + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstance /// 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) @@ -190,6 +212,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.BareMetal.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -211,7 +238,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzBareMetal_Get() { @@ -262,8 +289,33 @@ public GetAzBareMetal_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.BareMetal.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.BareMetal.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -316,7 +368,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -337,7 +389,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -375,12 +427,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -397,15 +449,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -415,12 +467,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstance + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstance /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -432,8 +484,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstance - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstance + 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/BareMetal/BareMetal.Autorest/generated/cmdlets/GetAzBareMetal_List.cs b/generated/BareMetal/BareMetal.Autorest/generated/cmdlets/GetAzBareMetal_List.cs index 829a9a0ea9c5..a3b83963e4d3 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/cmdlets/GetAzBareMetal_List.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/cmdlets/GetAzBareMetal_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Cmdlets; using System; /// @@ -16,12 +18,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Cmdlets /// [OpenAPI] ListBySubscription=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.BareMetalInfrastructure/bareMetalInstances" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzBareMetal_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstance))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstance))] [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Description(@"Gets a list of AzureBareMetal instances in the specified subscription. The operations returns various properties of each Azure BareMetal instance.")] [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.BareMetalInfrastructure/bareMetalInstances", ApiVersion = "2021-08-09")] public partial class GetAzBareMetal_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -37,17 +40,32 @@ public partial class GetAzBareMetal_List : global::System.Management.Automation. /// 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.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.BareMetal Client => Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Module.Instance.ClientAPI; @@ -61,6 +79,9 @@ public partial class GetAzBareMetal_List : global::System.Management.Automation. [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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 GetAzBareMetal_List : global::System.Management.Automation. /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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")] @@ -119,7 +140,8 @@ public partial class GetAzBareMetal_List : global::System.Management.Automation. [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -128,24 +150,24 @@ public partial class GetAzBareMetal_List : global::System.Management.Automation. /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Models.Api20210809.IAzureBareMetalInstancesListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancesListResult /// 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) @@ -168,6 +190,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.BareMetal.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -189,7 +216,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzBareMetal_List() { @@ -240,8 +267,33 @@ public GetAzBareMetal_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.BareMetal.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.BareMetal.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -294,7 +346,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -315,7 +367,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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 } }); @@ -353,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.BareMetal.Models.Api20210809.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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 ) { @@ -375,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.BareMetal.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.BareMetal.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 } }); @@ -393,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.BareMetal.Models.Api20210809.IAzureBareMetalInstancesListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancesListResult /// 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,15 +462,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancesListResult + 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/BareMetal/BareMetal.Autorest/generated/cmdlets/GetAzBareMetal_List1.cs b/generated/BareMetal/BareMetal.Autorest/generated/cmdlets/GetAzBareMetal_List1.cs index 1d283300b06a..abb163ae7b5f 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/cmdlets/GetAzBareMetal_List1.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/cmdlets/GetAzBareMetal_List1.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Cmdlets; using System; /// @@ -16,12 +18,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Cmdlets /// [OpenAPI] ListByResourceGroup=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BareMetalInfrastructure/bareMetalInstances" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzBareMetal_List1")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstance))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstance))] [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Description(@"Gets a list of AzureBareMetal instances in the specified subscription and resource group. The operations returns various properties of each Azure BareMetal instance.")] [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BareMetalInfrastructure/bareMetalInstances", ApiVersion = "2021-08-09")] public partial class GetAzBareMetal_List1 : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -37,17 +40,32 @@ public partial class GetAzBareMetal_List1 : global::System.Management.Automation /// 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.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.BareMetal Client => Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Module.Instance.ClientAPI; @@ -61,6 +79,9 @@ public partial class GetAzBareMetal_List1 : global::System.Management.Automation [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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 GetAzBareMetal_List1 : global::System.Management.Automation /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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")] @@ -133,7 +154,8 @@ public partial class GetAzBareMetal_List1 : global::System.Management.Automation [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -142,24 +164,24 @@ public partial class GetAzBareMetal_List1 : global::System.Management.Automation /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Models.Api20210809.IAzureBareMetalInstancesListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancesListResult /// 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) @@ -182,6 +204,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.BareMetal.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -203,7 +230,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzBareMetal_List1() { @@ -254,8 +281,33 @@ public GetAzBareMetal_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.BareMetal.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.BareMetal.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -308,7 +360,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -329,7 +381,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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 } }); @@ -367,12 +419,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.BareMetal.Models.Api20210809.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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 ) { @@ -389,15 +441,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.BareMetal.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.BareMetal.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 } }); @@ -407,12 +459,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.BareMetal.Models.Api20210809.IAzureBareMetalInstancesListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancesListResult /// 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,15 +476,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstancesListResult + 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/BareMetal/BareMetal.Autorest/generated/cmdlets/UpdateAzBareMetal_UpdateExpanded.cs b/generated/BareMetal/BareMetal.Autorest/generated/cmdlets/UpdateAzBareMetal_UpdateExpanded.cs index 974114e29418..62cf21fa0ea9 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/cmdlets/UpdateAzBareMetal_UpdateExpanded.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/cmdlets/UpdateAzBareMetal_UpdateExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Cmdlets; using System; /// @@ -15,12 +17,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Cmdlets /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BareMetalInfrastructure/bareMetalInstances/{azureBareMetalInstanceName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzBareMetal_UpdateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstance))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstance))] [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Description(@"Patches the Tags field of a Azure BareMetal instance for the specified subscription, resource group, and instance name.")] [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BareMetalInfrastructure/bareMetalInstances/{azureBareMetalInstanceName}", ApiVersion = "2021-08-09")] public partial class UpdateAzBareMetal_UpdateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -36,14 +39,29 @@ public partial class UpdateAzBareMetal_UpdateExpanded : 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; + /// Tags field of the AzureBareMetal instance. - private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags1 _tagsParameterBody = new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.Tags1(); + private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITags1 _tagsParameterBody = new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Tags1(); /// 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.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.BareMetal Client => Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Module.Instance.ClientAPI; @@ -57,6 +75,9 @@ public partial class UpdateAzBareMetal_UpdateExpanded : global::System.Managemen [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -98,7 +119,7 @@ public partial class UpdateAzBareMetal_UpdateExpanded : global::System.Managemen /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -144,7 +165,8 @@ public partial class UpdateAzBareMetal_UpdateExpanded : global::System.Managemen [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -157,32 +179,32 @@ public partial class UpdateAzBareMetal_UpdateExpanded : global::System.Managemen ReadOnly = false, Description = @"Tags field of the AzureBareMetal instance.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags Tag { get => _tagsParameterBody.Tag ?? null /* object */; set => _tagsParameterBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITags) })] + public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITags Tag { get => _tagsParameterBody.Tag ?? null /* object */; set => _tagsParameterBody.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.BareMetal.Models.Api20210809.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Models.Api20210809.IAzureBareMetalInstance + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstance /// 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) @@ -205,6 +227,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.BareMetal.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -269,8 +296,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.BareMetal.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.BareMetal.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -326,7 +378,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -339,12 +391,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.AzureBareMetalInstancesUpdate(SubscriptionId, ResourceGroupName, Name, _tagsParameterBody, onOk, onDefault, this, Pipeline); + await this.Client.AzureBareMetalInstancesUpdate(SubscriptionId, ResourceGroupName, Name, _tagsParameterBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeUpdate); await ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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=_tagsParameterBody}) + 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 } }); @@ -364,7 +416,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzBareMetal_UpdateExpanded() { @@ -390,12 +442,12 @@ public UpdateAzBareMetal_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.BareMetal.Models.Api20210809.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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 ) { @@ -412,15 +464,15 @@ public UpdateAzBareMetal_UpdateExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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=_tagsParameterBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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=_tagsParameterBody }) + 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 } }); @@ -430,12 +482,12 @@ public UpdateAzBareMetal_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.BareMetal.Models.Api20210809.IAzureBareMetalInstance + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstance /// 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 ) { @@ -447,8 +499,26 @@ public UpdateAzBareMetal_UpdateExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstance - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstance + 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/BareMetal/BareMetal.Autorest/generated/cmdlets/UpdateAzBareMetal_UpdateViaIdentityExpanded.cs b/generated/BareMetal/BareMetal.Autorest/generated/cmdlets/UpdateAzBareMetal_UpdateViaIdentityExpanded.cs index 901edfbd56f1..60e6dfa3933d 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/cmdlets/UpdateAzBareMetal_UpdateViaIdentityExpanded.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/cmdlets/UpdateAzBareMetal_UpdateViaIdentityExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Cmdlets; using System; /// @@ -15,12 +17,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Cmdlets /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BareMetalInfrastructure/bareMetalInstances/{azureBareMetalInstanceName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzBareMetal_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstance))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstance))] [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Description(@"Patches the Tags field of a Azure BareMetal instance for the specified subscription, resource group, and instance name.")] [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BareMetalInfrastructure/bareMetalInstances/{azureBareMetalInstanceName}", ApiVersion = "2021-08-09")] public partial class UpdateAzBareMetal_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -36,14 +39,29 @@ public partial class UpdateAzBareMetal_UpdateViaIdentityExpanded : 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; + /// Tags field of the AzureBareMetal instance. - private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags1 _tagsParameterBody = new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.Tags1(); + private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITags1 _tagsParameterBody = new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Tags1(); /// 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.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.BareMetal Client => Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Module.Instance.ClientAPI; @@ -57,6 +75,9 @@ public partial class UpdateAzBareMetal_UpdateViaIdentityExpanded : global::Syste [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -91,7 +112,7 @@ public partial class UpdateAzBareMetal_UpdateViaIdentityExpanded : global::Syste /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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,32 +139,32 @@ public partial class UpdateAzBareMetal_UpdateViaIdentityExpanded : global::Syste ReadOnly = false, Description = @"Tags field of the AzureBareMetal instance.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags Tag { get => _tagsParameterBody.Tag ?? null /* object */; set => _tagsParameterBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITags) })] + public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.ITags Tag { get => _tagsParameterBody.Tag ?? null /* object */; set => _tagsParameterBody.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.BareMetal.Models.Api20210809.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Models.Api20210809.IAzureBareMetalInstance + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstance /// 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.BareMetal.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -230,8 +256,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.BareMetal.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.BareMetal.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -302,7 +353,7 @@ protected override void ProcessRecord() await ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } if (InputObject?.Id != null) { - await this.Client.AzureBareMetalInstancesUpdateViaIdentity(InputObject.Id, _tagsParameterBody, onOk, onDefault, this, Pipeline); + await this.Client.AzureBareMetalInstancesUpdateViaIdentity(InputObject.Id, _tagsParameterBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeUpdate); } else { @@ -319,13 +370,13 @@ protected override void ProcessRecord() { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AzureBareMetalInstanceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - await this.Client.AzureBareMetalInstancesUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.AzureBareMetalInstanceName ?? null, _tagsParameterBody, onOk, onDefault, this, Pipeline); + await this.Client.AzureBareMetalInstancesUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.AzureBareMetalInstanceName ?? null, _tagsParameterBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeUpdate); } await ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_tagsParameterBody}) + 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 } }); @@ -345,7 +396,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzBareMetal_UpdateViaIdentityExpanded() { @@ -371,12 +422,12 @@ public UpdateAzBareMetal_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.BareMetal.Models.Api20210809.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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 ) { @@ -393,15 +444,15 @@ public UpdateAzBareMetal_UpdateViaIdentityExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_tagsParameterBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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=_tagsParameterBody }) + 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 } }); @@ -411,12 +462,12 @@ public UpdateAzBareMetal_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.BareMetal.Models.Api20210809.IAzureBareMetalInstance + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstance /// 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 ) { @@ -428,8 +479,26 @@ public UpdateAzBareMetal_UpdateViaIdentityExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstance - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstance + 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/BareMetal/BareMetal.Autorest/generated/cmdlets/UpdateAzBareMetal_UpdateViaJsonFilePath.cs b/generated/BareMetal/BareMetal.Autorest/generated/cmdlets/UpdateAzBareMetal_UpdateViaJsonFilePath.cs new file mode 100644 index 000000000000..57de883fd429 --- /dev/null +++ b/generated/BareMetal/BareMetal.Autorest/generated/cmdlets/UpdateAzBareMetal_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.BareMetal.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Cmdlets; + using System; + + /// + /// Patches the Tags field of a Azure BareMetal instance for the specified subscription, resource group, and instance name. + /// + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BareMetalInfrastructure/bareMetalInstances/{azureBareMetalInstanceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzBareMetal_UpdateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstance))] + [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Description(@"Patches the Tags field of a Azure BareMetal instance for the specified subscription, resource group, and instance name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BareMetalInfrastructure/bareMetalInstances/{azureBareMetalInstanceName}", ApiVersion = "2021-08-09")] + [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.NotSuggestDefaultParameterSet] + public partial class UpdateAzBareMetal_UpdateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.BareMetal Client => Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.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.BareMetal.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the Azure BareMetal on Azure instance. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the Azure BareMetal on Azure instance.")] + [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the Azure BareMetal on Azure instance.", + SerializedName = @"azureBareMetalInstanceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("AzureBareMetalInstanceName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.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.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.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.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.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.BareMetal.Models.IAzureBareMetalInstance + /// 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.BareMetal.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.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.BareMetal.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.BareMetal.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.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.BareMetal.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'AzureBareMetalInstancesUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.AzureBareMetalInstancesUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzBareMetal_UpdateViaJsonFilePath() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.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.BareMetal.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.BareMetal.Models.IAzureBareMetalInstance + /// 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.BareMetal.Models.IAzureBareMetalInstance + 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/BareMetal/BareMetal.Autorest/generated/cmdlets/UpdateAzBareMetal_UpdateViaJsonString.cs b/generated/BareMetal/BareMetal.Autorest/generated/cmdlets/UpdateAzBareMetal_UpdateViaJsonString.cs new file mode 100644 index 000000000000..29f3d071a229 --- /dev/null +++ b/generated/BareMetal/BareMetal.Autorest/generated/cmdlets/UpdateAzBareMetal_UpdateViaJsonString.cs @@ -0,0 +1,524 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Cmdlets; + using System; + + /// + /// Patches the Tags field of a Azure BareMetal instance for the specified subscription, resource group, and instance name. + /// + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BareMetalInfrastructure/bareMetalInstances/{azureBareMetalInstanceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzBareMetal_UpdateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IAzureBareMetalInstance))] + [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Description(@"Patches the Tags field of a Azure BareMetal instance for the specified subscription, resource group, and instance name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BareMetalInfrastructure/bareMetalInstances/{azureBareMetalInstanceName}", ApiVersion = "2021-08-09")] + [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.NotSuggestDefaultParameterSet] + public partial class UpdateAzBareMetal_UpdateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.BareMetal Client => Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.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.BareMetal.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the Azure BareMetal on Azure instance. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the Azure BareMetal on Azure instance.")] + [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the Azure BareMetal on Azure instance.", + SerializedName = @"azureBareMetalInstanceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("AzureBareMetalInstanceName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.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.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.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.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.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.BareMetal.Models.IAzureBareMetalInstance + /// 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.BareMetal.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.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.BareMetal.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.BareMetal.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.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.BareMetal.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'AzureBareMetalInstancesUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.AzureBareMetalInstancesUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzBareMetal_UpdateViaJsonString() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.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.BareMetal.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.BareMetal.Models.IAzureBareMetalInstance + /// 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.BareMetal.Models.IAzureBareMetalInstance + 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/BareMetal/BareMetal.Autorest/generated/runtime/Attributes/ExternalDocsAttribute.cs b/generated/BareMetal/BareMetal.Autorest/generated/runtime/Attributes/ExternalDocsAttribute.cs new file mode 100644 index 000000000000..addc82604f95 --- /dev/null +++ b/generated/BareMetal/BareMetal.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.BareMetal +{ + 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/BareMetal/BareMetal.Autorest/generated/runtime/Attributes/PSArgumentCompleterAttribute.cs b/generated/BareMetal/BareMetal.Autorest/generated/runtime/Attributes/PSArgumentCompleterAttribute.cs new file mode 100644 index 000000000000..ccc4561ceb1c --- /dev/null +++ b/generated/BareMetal/BareMetal.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.BareMetal +{ + 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/BareMetal/BareMetal.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs b/generated/BareMetal/BareMetal.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs index 76497b28886a..1bc3d2861956 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs +++ b/generated/BareMetal/BareMetal.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.BareMetal.Models"; - private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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/BareMetal/BareMetal.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs b/generated/BareMetal/BareMetal.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs index da66874f82b6..eda60e94df47 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs +++ b/generated/BareMetal/BareMetal.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.BareMetal.Models"; - private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support"; + private const string SupportNamespace = @"${$project.supportNamespace.fullName}"; protected override void ProcessRecord() { diff --git a/generated/BareMetal/BareMetal.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs b/generated/BareMetal/BareMetal.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs index a56de2825dcd..9444b4e5fc31 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs +++ b/generated/BareMetal/BareMetal.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/BareMetal/BareMetal.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs b/generated/BareMetal/BareMetal.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs index bf1fadaa9ccb..91b563162cba 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs +++ b/generated/BareMetal/BareMetal.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/BareMetal/BareMetal.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs b/generated/BareMetal/BareMetal.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs index e445e297bcac..afd3ebf4bc5b 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs @@ -12,50 +12,96 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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/BareMetal/BareMetal.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs b/generated/BareMetal/BareMetal.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs index ac14a7050a4b..69372a6973cf 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs +++ b/generated/BareMetal/BareMetal.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/BareMetal/BareMetal.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs b/generated/BareMetal/BareMetal.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs index bc3cabc19e7b..91723dbaf8b6 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs +++ b/generated/BareMetal/BareMetal.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/BareMetal/BareMetal.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs b/generated/BareMetal/BareMetal.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs index bcb0568bcc55..0a54dffbbe4c 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs +++ b/generated/BareMetal/BareMetal.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.BareMetal.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.BareMetal.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.BareMetal.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/BareMetal/BareMetal.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs b/generated/BareMetal/BareMetal.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs index 5d7de2307a12..1ea5833e8942 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs @@ -31,7 +31,7 @@ internal class VariantGroup { public string ModuleName { get; } - public string RootModuleName {get => @"";} + public string RootModuleName { get => @""; } public string CmdletName { get; } public string CmdletVerb { get; } public string CmdletNoun { get; } @@ -49,7 +49,7 @@ internal class VariantGroup public PsHelpInfo HelpInfo { get; } public bool IsGenerated { get; } public bool IsInternal { get; } - + public bool IsModelCmdlet { get; } public string OutputFolder { get; } public string FileName { get; } public string FilePath { get; } @@ -84,7 +84,7 @@ public VariantGroup(string moduleName, string cmdletName, Variant[] variants, st HelpInfo = Variants.Select(v => v.HelpInfo).FirstOrDefault() ?? new PsHelpInfo(); IsGenerated = Variants.All(v => v.Attributes.OfType().Any()); IsInternal = isInternal; - + IsModelCmdlet = Variants.All(v => v.IsModelCmdlet); OutputFolder = outputFolder; FileName = $"{CmdletName}{(isTest ? ".Tests" : String.Empty)}.ps1"; FilePath = Path.Combine(OutputFolder, FileName); @@ -101,12 +101,23 @@ private string DetermineDefaultParameterSetName() if (String.IsNullOrEmpty(defaultParameterSet)) { var variantParamCountGroups = Variants + .Where(v => !v.IsNotSuggestDefaultParameterSet) .Select(v => ( variant: v.VariantName, paramCount: v.CmdletOnlyParameters.Count(p => p.IsMandatory), isSimple: v.CmdletOnlyParameters.Where(p => p.IsMandatory).All(p => p.ParameterType.IsPsSimple()))) .GroupBy(vpc => vpc.isSimple) .ToArray(); + if (variantParamCountGroups.Length == 0) + { + variantParamCountGroups = Variants + .Select(v => ( + variant: v.VariantName, + paramCount: v.CmdletOnlyParameters.Count(p => p.IsMandatory), + isSimple: v.CmdletOnlyParameters.Where(p => p.IsMandatory).All(p => p.ParameterType.IsPsSimple()))) + .GroupBy(vpc => vpc.isSimple) + .ToArray(); + } var variantParameterCounts = (variantParamCountGroups.Any(g => g.Key) ? variantParamCountGroups.Where(g => g.Key) : variantParamCountGroups).SelectMany(g => g).ToArray(); var smallestParameterCount = variantParameterCounts.Min(vpc => vpc.paramCount); defaultParameterSet = variantParameterCounts.First(vpc => vpc.paramCount == smallestParameterCount).variant; @@ -134,7 +145,9 @@ internal class Variant public Parameter[] Parameters { get; } public Parameter[] CmdletOnlyParameters { get; } public bool IsInternal { get; } + public bool IsModelCmdlet { get; } public bool IsDoNotExport { get; } + public bool IsNotSuggestDefaultParameterSet { get; } public string[] Profiles { get; } public Variant(string cmdletName, string variantName, CommandInfo info, CommandMetadata metadata, bool hasParameterSets = false, PsHelpInfo helpInfo = null) @@ -155,6 +168,8 @@ public Variant(string cmdletName, string variantName, CommandInfo info, CommandM Parameters = this.ToParameters().OrderBy(p => p.OrderCategory).ThenByDescending(p => p.IsMandatory).ToArray(); IsInternal = Attributes.OfType().Any(); IsDoNotExport = Attributes.OfType().Any(); + IsModelCmdlet = Attributes.OfType().Any(); + IsNotSuggestDefaultParameterSet = Attributes.OfType().Any(); CmdletOnlyParameters = Parameters.Where(p => !p.Categories.Any(c => c == ParameterCategory.Azure || c == ParameterCategory.Runtime)).ToArray(); Profiles = Attributes.OfType().SelectMany(pa => pa.Profiles).ToArray(); } @@ -210,6 +225,7 @@ public ParameterGroup(string parameterName, Parameter[] parameters, string[] all HasValidateNotNull = Parameters.SelectMany(p => p.Attributes.OfType()).Any(); HasAllowEmptyArray = Parameters.SelectMany(p => p.Attributes.OfType()).Any(); CompleterInfo = Parameters.Select(p => p.CompleterInfoAttribute).FirstOrDefault()?.ToCompleterInfo() + ?? Parameters.Select(p => p.PSArgumentCompleterAttribute).FirstOrDefault()?.ToPSArgumentCompleterInfo() ?? Parameters.Select(p => p.ArgumentCompleterAttribute).FirstOrDefault()?.ToCompleterInfo(); DefaultInfo = Parameters.Select(p => p.DefaultInfoAttribute).FirstOrDefault()?.ToDefaultInfo(this) ?? Parameters.Select(p => p.DefaultValueAttribute).FirstOrDefault(dv => dv != null)?.ToDefaultInfo(this); @@ -244,7 +260,6 @@ internal class Parameter public ParameterMetadata Metadata { get; } public PsParameterHelpInfo HelpInfo { get; } public Type ParameterType { get; } - public Attribute[] Attributes { get; } public ParameterCategory[] Categories { get; } public ParameterCategory OrderCategory { get; } @@ -254,6 +269,7 @@ internal class Parameter public bool SupportsWildcards { get; } public CompleterInfoAttribute CompleterInfoAttribute { get; } public ArgumentCompleterAttribute ArgumentCompleterAttribute { get; } + public PSArgumentCompleterAttribute PSArgumentCompleterAttribute { get; } public bool ValueFromPipeline { get; } public bool ValueFromPipelineByPropertyName { get; } @@ -286,7 +302,8 @@ public Parameter(string variantName, string parameterName, ParameterMetadata met } SupportsWildcards = Attributes.OfType().Any(); CompleterInfoAttribute = Attributes.OfType().FirstOrDefault(); - ArgumentCompleterAttribute = Attributes.OfType().FirstOrDefault(); + PSArgumentCompleterAttribute = Attributes.OfType().FirstOrDefault(); + ArgumentCompleterAttribute = Attributes.OfType().FirstOrDefault(attr => !attr.GetType().Equals(typeof(PSArgumentCompleterAttribute))); ValueFromPipeline = ParameterAttribute.ValueFromPipeline; ValueFromPipelineByPropertyName = ParameterAttribute.ValueFromPipelineByPropertyName; @@ -295,10 +312,10 @@ public Parameter(string variantName, string parameterName, ParameterMetadata met IsMandatory = ParameterAttribute.Mandatory; var complexParameterName = ParameterName.ToUpperInvariant(); - var complexMessage = $"{Environment.NewLine}To construct, see NOTES section for {complexParameterName} properties and create a hash table."; + var complexMessage = $"{Environment.NewLine}"; var description = ParameterAttribute.HelpMessage.NullIfEmpty() ?? HelpInfo.Description.NullIfEmpty() ?? InfoAttribute?.Description.NullIfEmpty() ?? String.Empty; // Remove the complex type message as it will be reinserted if this is a complex type - description = description.NormalizeNewLines().Replace(complexMessage, String.Empty).Replace(complexMessage.ToPsSingleLine(), String.Empty); + description = description.NormalizeNewLines(); // Make an InfoAttribute for processing only if one isn't provided InfoAttribute = Attributes.OfType().FirstOrDefault() ?? new InfoAttribute { PossibleTypes = new[] { ParameterType.Unwrap() }, Required = IsMandatory }; // Set the description if the InfoAttribute does not have one since they are exported without a description @@ -318,7 +335,7 @@ internal class ComplexInterfaceInfo public bool Required { get; } public bool ReadOnly { get; } public string Description { get; } - + public ComplexInterfaceInfo[] NestedInfos { get; } public bool IsComplexInterface { get; } @@ -335,7 +352,7 @@ public ComplexInterfaceInfo(string name, Type type, InfoAttribute infoAttribute, var unwrappedType = Type.Unwrap(); var hasBeenSeen = seenTypes?.Contains(unwrappedType) ?? false; (seenTypes ?? (seenTypes = new List())).Add(unwrappedType); - NestedInfos = hasBeenSeen ? new ComplexInterfaceInfo[]{} : + NestedInfos = hasBeenSeen ? new ComplexInterfaceInfo[] { } : unwrappedType.GetInterfaces() .Concat(InfoAttribute.PossibleTypes) .SelectMany(pt => pt.GetProperties() @@ -366,6 +383,7 @@ internal class CommentInfo public string OnlineVersion { get; } public string[] RelatedLinks { get; } + public string[] ExternalUrls { get; } private const string HelpLinkPrefix = @"https://learn.microsoft.com/powershell/module/"; @@ -391,6 +409,9 @@ public CommentInfo(VariantGroup variantGroup) var moduleName = variantGroup.RootModuleName == "" ? variantGroup.ModuleName.ToLowerInvariant() : variantGroup.RootModuleName.ToLowerInvariant(); OnlineVersion = helpInfo.OnlineVersion?.Uri.NullIfEmpty() ?? $@"{HelpLinkPrefix}{moduleName}/{variantGroup.CmdletName.ToLowerInvariant()}"; RelatedLinks = helpInfo.RelatedLinks.Select(rl => rl.Text).ToArray(); + + // Get external urls from attribute + ExternalUrls = variantGroup.Variants.SelectMany(v => v.Attributes).OfType()?.Select(e => e.Url)?.Distinct()?.ToArray(); } } @@ -420,11 +441,22 @@ public CompleterInfo(ArgumentCompleterAttribute completerAttribute) } } + internal class PSArgumentCompleterInfo : CompleterInfo + { + public string[] ResourceTypes { get; } + + public PSArgumentCompleterInfo(PSArgumentCompleterAttribute completerAttribute) : base(completerAttribute) + { + ResourceTypes = completerAttribute.ResourceTypes; + } + } + internal class DefaultInfo { public string Name { get; } public string Description { get; } public string Script { get; } + public string SetCondition { get; } public ParameterGroup ParameterGroup { get; } public DefaultInfo(DefaultInfoAttribute infoAttribute, ParameterGroup parameterGroup) @@ -432,6 +464,7 @@ public DefaultInfo(DefaultInfoAttribute infoAttribute, ParameterGroup parameterG Name = infoAttribute.Name; Description = infoAttribute.Description; Script = infoAttribute.Script; + SetCondition = infoAttribute.SetCondition; ParameterGroup = parameterGroup; } @@ -479,7 +512,8 @@ public static Parameter[] ToParameters(this Variant variant) parameterHelp = parameterHelp.Where(ph => (!ph.ParameterSetNames.Any() || ph.ParameterSetNames.Any(psn => psn == variant.VariantName || psn == AllParameterSets)) && ph.Name != "IncludeTotalCount"); } var result = parameters.Select(p => new Parameter(variant.VariantName, p.Key, p.Value, parameterHelp.FirstOrDefault(ph => ph.Name == p.Key))); - if (variant.SupportsPaging) { + if (variant.SupportsPaging) + { // If supportsPaging is set, we will need to add First and Skip parameters since they are treated as common parameters which as not contained on Metadata>parameters variant.Info.Parameters["First"].Attributes.OfType().FirstOrDefault(pa => pa.ParameterSetName == variant.VariantName || pa.ParameterSetName == AllParameterSets).HelpMessage = "Gets only the first 'n' objects."; variant.Info.Parameters["Skip"].Attributes.OfType().FirstOrDefault(pa => pa.ParameterSetName == variant.VariantName || pa.ParameterSetName == AllParameterSets).HelpMessage = "Ignores the first 'n' objects and then gets the remaining objects."; @@ -507,7 +541,7 @@ public static ComplexInterfaceInfo ToComplexInterfaceInfo(this InfoAttribute inf public static CompleterInfo ToCompleterInfo(this CompleterInfoAttribute infoAttribute) => new CompleterInfo(infoAttribute); public static CompleterInfo ToCompleterInfo(this ArgumentCompleterAttribute completerAttribute) => new CompleterInfo(completerAttribute); - + public static PSArgumentCompleterInfo ToPSArgumentCompleterInfo(this PSArgumentCompleterAttribute completerAttribute) => new PSArgumentCompleterInfo(completerAttribute); public static DefaultInfo ToDefaultInfo(this DefaultInfoAttribute infoAttribute, ParameterGroup parameterGroup) => new DefaultInfo(infoAttribute, parameterGroup); public static DefaultInfo ToDefaultInfo(this PSDefaultValueAttribute defaultValueAttribute, ParameterGroup parameterGroup) => new DefaultInfo(defaultValueAttribute, parameterGroup); } diff --git a/generated/BareMetal/BareMetal.Autorest/generated/runtime/BuildTime/PsAttributes.cs b/generated/BareMetal/BareMetal.Autorest/generated/runtime/BuildTime/PsAttributes.cs index a075e23f0df4..2c5e5424901f 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/runtime/BuildTime/PsAttributes.cs +++ b/generated/BareMetal/BareMetal.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/BareMetal/BareMetal.Autorest/generated/runtime/BuildTime/PsExtensions.cs b/generated/BareMetal/BareMetal.Autorest/generated/runtime/BuildTime/PsExtensions.cs index 3d8f2a5fde07..9b4a3ea97297 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/runtime/BuildTime/PsExtensions.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/runtime/BuildTime/PsExtensions.cs @@ -13,6 +13,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell { internal static class PsExtensions { + public static PSObject AddMultipleTypeNameIntoPSObject(this object obj, string multipleTag = "#Multiple") + { + var psObj = new PSObject(obj); + psObj.TypeNames.Insert(0, $"{psObj.TypeNames[0]}{multipleTag}"); + return psObj; + } + // https://stackoverflow.com/a/863944/294804 // https://stackoverflow.com/a/4452598/294804 // https://stackoverflow.com/a/28701974/294804 diff --git a/generated/BareMetal/BareMetal.Autorest/generated/runtime/BuildTime/PsHelpers.cs b/generated/BareMetal/BareMetal.Autorest/generated/runtime/BuildTime/PsHelpers.cs index 6c1006fa3719..2ec5bf22eb65 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/runtime/BuildTime/PsHelpers.cs +++ b/generated/BareMetal/BareMetal.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/BareMetal/BareMetal.Autorest/generated/runtime/Context.cs b/generated/BareMetal/BareMetal.Autorest/generated/runtime/Context.cs new file mode 100644 index 000000000000..56ba36ea848e --- /dev/null +++ b/generated/BareMetal/BareMetal.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.BareMetal.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.BareMetal.Runtime.Extensions; + + /// + /// The IContext Interface defines the communication mechanism for input customization. + /// + /// + /// In the context, we will have client, pipeline, PSBoundParamters, default EventListener, Cancellation. + /// + public interface IContext + { + System.Management.Automation.InvocationInfo InvocationInformation { get; set; } + System.Threading.CancellationTokenSource CancellationTokenSource { get; set; } + System.Collections.Generic.IDictionary ExtensibleParameters { get; } + HttpPipeline Pipeline { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.BareMetal.BareMetal Client { get; } + } +} diff --git a/generated/BareMetal/BareMetal.Autorest/generated/runtime/Events.cs b/generated/BareMetal/BareMetal.Autorest/generated/runtime/Events.cs index 69de936c0a68..59c80a9a2046 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/runtime/Events.cs +++ b/generated/BareMetal/BareMetal.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/BareMetal/BareMetal.Autorest/generated/runtime/ISendAsync.cs b/generated/BareMetal/BareMetal.Autorest/generated/runtime/ISendAsync.cs index 729bdc25462d..6e5ca513297f 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/runtime/ISendAsync.cs +++ b/generated/BareMetal/BareMetal.Autorest/generated/runtime/ISendAsync.cs @@ -11,6 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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/BareMetal/BareMetal.Autorest/generated/runtime/InfoAttribute.cs b/generated/BareMetal/BareMetal.Autorest/generated/runtime/InfoAttribute.cs index 4bf925122eae..9a1d3e619cfc 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/runtime/InfoAttribute.cs +++ b/generated/BareMetal/BareMetal.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/BareMetal/BareMetal.Autorest/generated/runtime/InputHandler.cs b/generated/BareMetal/BareMetal.Autorest/generated/runtime/InputHandler.cs new file mode 100644 index 000000000000..e00a14141789 --- /dev/null +++ b/generated/BareMetal/BareMetal.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.BareMetal.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.BareMetal.Runtime.IContext context); + } +} \ No newline at end of file diff --git a/generated/BareMetal/BareMetal.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs b/generated/BareMetal/BareMetal.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs index 383617097f89..32ffaad08a7c 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs +++ b/generated/BareMetal/BareMetal.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/BareMetal/BareMetal.Autorest/generated/runtime/SerializationMode.cs b/generated/BareMetal/BareMetal.Autorest/generated/runtime/SerializationMode.cs index f11c4fa8e81b..838c9799e83c 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/runtime/SerializationMode.cs +++ b/generated/BareMetal/BareMetal.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/BareMetal/BareMetal.Autorest/generated/runtime/TypeConverterExtensions.cs b/generated/BareMetal/BareMetal.Autorest/generated/runtime/TypeConverterExtensions.cs index ebd2a01867f0..19ed92000ec1 100644 --- a/generated/BareMetal/BareMetal.Autorest/generated/runtime/TypeConverterExtensions.cs +++ b/generated/BareMetal/BareMetal.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/BareMetal/BareMetal.Autorest/internal/Get-AzBareMetalOperation.ps1 b/generated/BareMetal/BareMetal.Autorest/internal/Get-AzBareMetalOperation.ps1 index 895e175dbbad..d1765f508c64 100644 --- a/generated/BareMetal/BareMetal.Autorest/internal/Get-AzBareMetalOperation.ps1 +++ b/generated/BareMetal/BareMetal.Autorest/internal/Get-AzBareMetalOperation.ps1 @@ -25,12 +25,12 @@ Gets a list of AzureBareMetal management operations. {{ Add code here }} .Outputs -Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperation +Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperation .Link https://learn.microsoft.com/powershell/module/az.baremetal/get-azbaremetaloperation #> function Get-AzBareMetalOperation { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperation])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperation])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter()] @@ -89,12 +89,18 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ List = 'Az.BareMetal.private\Get-AzBareMetalOperation_List'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/BareMetal/BareMetal.Autorest/internal/ProxyCmdletDefinitions.ps1 b/generated/BareMetal/BareMetal.Autorest/internal/ProxyCmdletDefinitions.ps1 index 895e175dbbad..d1765f508c64 100644 --- a/generated/BareMetal/BareMetal.Autorest/internal/ProxyCmdletDefinitions.ps1 +++ b/generated/BareMetal/BareMetal.Autorest/internal/ProxyCmdletDefinitions.ps1 @@ -25,12 +25,12 @@ Gets a list of AzureBareMetal management operations. {{ Add code here }} .Outputs -Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperation +Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperation .Link https://learn.microsoft.com/powershell/module/az.baremetal/get-azbaremetaloperation #> function Get-AzBareMetalOperation { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperation])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IOperation])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter()] @@ -89,12 +89,18 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ List = 'Az.BareMetal.private\Get-AzBareMetalOperation_List'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/BareMetal/BareMetal.Autorest/resources/README.md b/generated/BareMetal/BareMetal.Autorest/resources/README.md new file mode 100644 index 000000000000..937f07f8fec2 --- /dev/null +++ b/generated/BareMetal/BareMetal.Autorest/resources/README.md @@ -0,0 +1,11 @@ +# Resources +This directory can contain any additional resources for module that are not required at runtime. This directory **does not** get packaged with the module. If you have assets for custom implementation, place them into the `..\custom` folder. + +## Info +- Modifiable: yes +- Generated: no +- Committed: yes +- Packaged: no + +## Purpose +Use this folder to put anything you want to keep around as part of the repository for the module, but is not something that is required for the module. For example, development files, packaged builds, or additional information. This is only intended to be used in repositories where the module's output directory is cleaned, but tangential resources for the module want to remain intact. \ No newline at end of file diff --git a/generated/BareMetal/BareMetal.Autorest/test-module.ps1 b/generated/BareMetal/BareMetal.Autorest/test-module.ps1 index 38d3fa7f7b05..32ed471da7a7 100644 --- a/generated/BareMetal/BareMetal.Autorest/test-module.ps1 +++ b/generated/BareMetal/BareMetal.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/BotService/BotService.Autorest/Az.BotService.csproj b/generated/BotService/BotService.Autorest/Az.BotService.csproj index f4bbf577d50c..5e904750a329 100644 --- a/generated/BotService/BotService.Autorest/Az.BotService.csproj +++ b/generated/BotService/BotService.Autorest/Az.BotService.csproj @@ -2,9 +2,9 @@ BotService BotService + BotService.Autorest - diff --git a/generated/BotService/BotService.Autorest/Az.BotService.format.ps1xml b/generated/BotService/BotService.Autorest/Az.BotService.format.ps1xml index 8a758f04befe..4ee496c816f4 100644 --- a/generated/BotService/BotService.Autorest/Az.BotService.format.ps1xml +++ b/generated/BotService/BotService.Autorest/Az.BotService.format.ps1xml @@ -2,61 +2,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.BotServiceIdentity + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.AlexaChannel - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.BotServiceIdentity - - - - - - - - - - - - - - - - - - - - - - - - - - - ChannelName - - - ConnectionName - - - PrivateEndpointConnectionName - - - ResourceGroupName - - - ResourceName - - - SubscriptionId - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.AlexaChannel - - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.AlexaChannel + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.AlexaChannel#Multiple @@ -94,9 +42,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.AlexaChannelProperties + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.AlexaChannelProperties - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.AlexaChannelProperties + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.AlexaChannelProperties#Multiple @@ -134,9 +82,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Bot + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Bot - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Bot + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Bot#Multiple @@ -159,7 +107,7 @@ - + @@ -184,7 +132,7 @@ SkuTier - Zone + ResourceGroupName @@ -192,9 +140,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.BotChannel + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.BotChannel - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.BotChannel + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.BotChannel#Multiple @@ -217,7 +165,7 @@ - + @@ -242,7 +190,7 @@ SkuTier - Zone + ResourceGroupName @@ -250,9 +198,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.BotProperties + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.BotProperties - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.BotProperties + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.BotProperties#Multiple @@ -265,9 +213,6 @@ - - - @@ -286,9 +231,6 @@ - - - @@ -307,9 +249,6 @@ - - - @@ -365,9 +304,6 @@ CmekKeyVaultUrl - - ConfiguredChannel - Description @@ -386,9 +322,6 @@ DisplayName - - EnabledChannel - Endpoint @@ -407,9 +340,6 @@ IsStreamingSupported - - LuisAppId - LuisKey @@ -458,9 +388,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.BotPropertiesAllSettings + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.BotPropertiesAllSettings - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.BotPropertiesAllSettings + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.BotPropertiesAllSettings#Multiple @@ -480,9 +410,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.BotPropertiesParameters + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.BotPropertiesParameters - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.BotPropertiesParameters + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.BotPropertiesParameters#Multiple @@ -502,9 +432,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.BotResponseList + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.BotResponseList - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.BotResponseList + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.BotResponseList#Multiple @@ -524,9 +454,61 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Channel + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.BotServiceIdentity + + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.BotServiceIdentity#Multiple + + + + + + + + + + + + + + + + + + + + + + + + + + + ChannelName + + + ConnectionName + + + PrivateEndpointConnectionName + + + ResourceGroupName + + + ResourceName + + + SubscriptionId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Channel - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Channel + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Channel#Multiple @@ -564,9 +546,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ChannelResponseList + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ChannelResponseList - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ChannelResponseList + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ChannelResponseList#Multiple @@ -586,9 +568,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ChannelSettings + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ChannelSettings - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ChannelSettings + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ChannelSettings#Multiple @@ -650,9 +632,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.CheckNameAvailabilityRequestBody + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.CheckNameAvailabilityRequestBody - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.CheckNameAvailabilityRequestBody + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.CheckNameAvailabilityRequestBody#Multiple @@ -672,9 +654,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.CheckNameAvailabilityResponseBody + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.CheckNameAvailabilityResponseBody - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.CheckNameAvailabilityResponseBody + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.CheckNameAvailabilityResponseBody#Multiple @@ -700,9 +682,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ConnectionItemName + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ConnectionItemName - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ConnectionItemName + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ConnectionItemName#Multiple @@ -722,9 +704,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ConnectionSetting + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ConnectionSetting - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ConnectionSetting + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ConnectionSetting#Multiple @@ -747,7 +729,7 @@ - + @@ -772,7 +754,7 @@ SkuTier - Zone + ResourceGroupName @@ -780,9 +762,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ConnectionSettingParameter + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ConnectionSettingParameter - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ConnectionSettingParameter + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ConnectionSettingParameter#Multiple @@ -808,9 +790,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ConnectionSettingProperties + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ConnectionSettingProperties - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ConnectionSettingProperties + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ConnectionSettingProperties#Multiple @@ -872,9 +854,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ConnectionSettingResponseList + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ConnectionSettingResponseList - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ConnectionSettingResponseList + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ConnectionSettingResponseList#Multiple @@ -894,15 +876,18 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.CreateEmailSignInUrlResponse + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.CreateEmailSignInUrlResponse - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.CreateEmailSignInUrlResponse + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.CreateEmailSignInUrlResponse#Multiple + + + @@ -910,15 +895,18 @@ Location + + ResourceGroupName + - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.CreateEmailSignInUrlResponseProperties + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.CreateEmailSignInUrlResponseProperties - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.CreateEmailSignInUrlResponseProperties + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.CreateEmailSignInUrlResponseProperties#Multiple @@ -938,9 +926,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.DirectLineChannel + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.DirectLineChannel - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.DirectLineChannel + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.DirectLineChannel#Multiple @@ -978,9 +966,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.DirectLineChannelProperties + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.DirectLineChannelProperties - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.DirectLineChannelProperties + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.DirectLineChannelProperties#Multiple @@ -1012,9 +1000,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.DirectLineSite + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.DirectLineSite - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.DirectLineSite + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.DirectLineSite#Multiple @@ -1063,9 +1051,6 @@ - - - @@ -1115,18 +1100,15 @@ Name - - TrustedOrigin - - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.DirectLineSpeechChannel + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.DirectLineSpeechChannel - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.DirectLineSpeechChannel + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.DirectLineSpeechChannel#Multiple @@ -1164,9 +1146,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.DirectLineSpeechChannelProperties + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.DirectLineSpeechChannelProperties - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.DirectLineSpeechChannelProperties + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.DirectLineSpeechChannelProperties#Multiple @@ -1222,9 +1204,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.EmailChannel + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.EmailChannel - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.EmailChannel + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.EmailChannel#Multiple @@ -1262,9 +1244,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.EmailChannelProperties + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.EmailChannelProperties - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.EmailChannelProperties + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.EmailChannelProperties#Multiple @@ -1308,9 +1290,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ErrorBody + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ErrorBody - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ErrorBody + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ErrorBody#Multiple @@ -1336,9 +1318,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.FacebookChannel + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.FacebookChannel - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.FacebookChannel + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.FacebookChannel#Multiple @@ -1376,9 +1358,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.FacebookChannelProperties + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.FacebookChannelProperties - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.FacebookChannelProperties + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.FacebookChannelProperties#Multiple @@ -1422,9 +1404,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.FacebookPage + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.FacebookPage - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.FacebookPage + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.FacebookPage#Multiple @@ -1444,9 +1426,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.HostSettingsResponse + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.HostSettingsResponse - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.HostSettingsResponse + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.HostSettingsResponse#Multiple @@ -1508,9 +1490,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.KikChannel + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.KikChannel - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.KikChannel + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.KikChannel#Multiple @@ -1548,9 +1530,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.KikChannelProperties + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.KikChannelProperties - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.KikChannelProperties + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.KikChannelProperties#Multiple @@ -1588,9 +1570,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.LineChannel + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.LineChannel - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.LineChannel + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.LineChannel#Multiple @@ -1628,9 +1610,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.LineChannelProperties + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.LineChannelProperties - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.LineChannelProperties + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.LineChannelProperties#Multiple @@ -1656,9 +1638,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.LineRegistration + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.LineRegistration - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.LineRegistration + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.LineRegistration#Multiple @@ -1690,9 +1672,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ListChannelWithKeysResponse + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ListChannelWithKeysResponse - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ListChannelWithKeysResponse + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ListChannelWithKeysResponse#Multiple @@ -1726,9 +1708,6 @@ - - - @@ -1738,6 +1717,9 @@ + + + @@ -1772,9 +1754,6 @@ SkuTier - - Zone - ChangedTime @@ -1784,15 +1763,18 @@ ProvisioningState + + ResourceGroupName + - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.MSTeamsChannel + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.MSTeamsChannel - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.MSTeamsChannel + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.MSTeamsChannel#Multiple @@ -1830,9 +1812,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.MSTeamsChannelProperties + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.MSTeamsChannelProperties - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.MSTeamsChannelProperties + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.MSTeamsChannelProperties#Multiple @@ -1882,9 +1864,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.OperationDisplayInfo + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.OperationDisplayInfo - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.OperationDisplayInfo + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.OperationDisplayInfo#Multiple @@ -1922,9 +1904,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.OperationEntity + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.OperationEntity - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.OperationEntity + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.OperationEntity#Multiple @@ -1950,9 +1932,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.OperationEntityListResult + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.OperationEntityListResult - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.OperationEntityListResult + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.OperationEntityListResult#Multiple @@ -1972,9 +1954,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.OperationResultsDescription + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.OperationResultsDescription - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.OperationResultsDescription + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.OperationResultsDescription#Multiple @@ -2006,9 +1988,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.OutlookChannel + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.OutlookChannel - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.OutlookChannel + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.OutlookChannel#Multiple @@ -2046,15 +2028,18 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateEndpointConnection + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.PrivateEndpointConnection - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateEndpointConnection + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.PrivateEndpointConnection#Multiple + + + @@ -2062,15 +2047,18 @@ Name + + ResourceGroupName + - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateEndpointConnectionProperties + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.PrivateEndpointConnectionProperties - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateEndpointConnectionProperties + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.PrivateEndpointConnectionProperties#Multiple @@ -2090,9 +2078,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateLinkResource + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.PrivateLinkResource - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateLinkResource + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.PrivateLinkResource#Multiple @@ -2112,9 +2100,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateLinkResourceBase + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.PrivateLinkResourceBase - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateLinkResourceBase + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.PrivateLinkResourceBase#Multiple @@ -2134,21 +2122,15 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateLinkResourceProperties + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.PrivateLinkResourceProperties - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateLinkResourceProperties + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.PrivateLinkResourceProperties#Multiple - - - - - - @@ -2156,21 +2138,15 @@ GroupId - - RequiredMember - - - RequiredZoneName - - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateLinkServiceConnectionState + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.PrivateLinkServiceConnectionState - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateLinkServiceConnectionState + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.PrivateLinkServiceConnectionState#Multiple @@ -2202,9 +2178,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.QnAMakerEndpointKeysRequestBody + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.QnAMakerEndpointKeysRequestBody - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.QnAMakerEndpointKeysRequestBody + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.QnAMakerEndpointKeysRequestBody#Multiple @@ -2230,9 +2206,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.QnAMakerEndpointKeysResponse + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.QnAMakerEndpointKeysResponse - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.QnAMakerEndpointKeysResponse + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.QnAMakerEndpointKeysResponse#Multiple @@ -2270,9 +2246,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Resource + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Resource - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Resource + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Resource#Multiple @@ -2288,9 +2264,6 @@ - - - @@ -2307,18 +2280,15 @@ Name - - Zone - - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ResourceTags + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ResourceTags - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ResourceTags + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ResourceTags#Multiple @@ -2338,9 +2308,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ServiceProviderParameter + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ServiceProviderParameter - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ServiceProviderParameter + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ServiceProviderParameter#Multiple @@ -2384,9 +2354,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ServiceProviderParameterMetadataConstraints + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ServiceProviderParameterMetadataConstraints - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ServiceProviderParameterMetadataConstraints + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ServiceProviderParameterMetadataConstraints#Multiple @@ -2406,9 +2376,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ServiceProviderProperties + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ServiceProviderProperties - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ServiceProviderProperties + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ServiceProviderProperties#Multiple @@ -2446,9 +2416,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ServiceProviderResponseList + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ServiceProviderResponseList - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ServiceProviderResponseList + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ServiceProviderResponseList#Multiple @@ -2468,9 +2438,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Site + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Site - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Site + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Site#Multiple @@ -2519,9 +2489,6 @@ - - - @@ -2571,18 +2538,15 @@ Name - - TrustedOrigin - - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SiteInfo + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.SiteInfo - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SiteInfo + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.SiteInfo#Multiple @@ -2608,9 +2572,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Sku + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Sku - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Sku + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Sku#Multiple @@ -2636,9 +2600,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SkypeChannel + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.SkypeChannel - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SkypeChannel + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.SkypeChannel#Multiple @@ -2676,9 +2640,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SkypeChannelProperties + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.SkypeChannelProperties - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SkypeChannelProperties + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.SkypeChannelProperties#Multiple @@ -2752,9 +2716,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SlackChannel + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.SlackChannel - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SlackChannel + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.SlackChannel#Multiple @@ -2792,9 +2756,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SlackChannelProperties + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.SlackChannelProperties - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SlackChannelProperties + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.SlackChannelProperties#Multiple @@ -2874,9 +2838,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SmsChannel + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.SmsChannel - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SmsChannel + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.SmsChannel#Multiple @@ -2914,9 +2878,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SmsChannelProperties + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.SmsChannelProperties - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SmsChannelProperties + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.SmsChannelProperties#Multiple @@ -2960,9 +2924,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.TelegramChannel + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.TelegramChannel - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.TelegramChannel + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.TelegramChannel#Multiple @@ -3000,9 +2964,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.TelegramChannelProperties + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.TelegramChannelProperties - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.TelegramChannelProperties + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.TelegramChannelProperties#Multiple @@ -3034,9 +2998,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.WebChatChannel + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.WebChatChannel - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.WebChatChannel + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.WebChatChannel#Multiple @@ -3074,9 +3038,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.WebChatChannelProperties + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.WebChatChannelProperties - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.WebChatChannelProperties + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.WebChatChannelProperties#Multiple @@ -3096,9 +3060,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.WebChatSite + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.WebChatSite - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.WebChatSite + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.WebChatSite#Multiple @@ -3147,9 +3111,6 @@ - - - @@ -3199,9 +3160,6 @@ Name - - TrustedOrigin - diff --git a/generated/BotService/BotService.Autorest/Az.BotService.psd1 b/generated/BotService/BotService.Autorest/Az.BotService.psd1 index 468daf6af169..6dffd80a07d8 100644 --- a/generated/BotService/BotService.Autorest/Az.BotService.psd1 +++ b/generated/BotService/BotService.Autorest/Az.BotService.psd1 @@ -11,8 +11,7 @@ DotNetFrameworkVersion = '4.7.2' RequiredAssemblies = './bin/Az.BotService.private.dll' FormatsToProcess = './Az.BotService.format.ps1xml' - FunctionsToExport = 'Export-AzBotServiceApp', 'Get-AzBotService', 'Get-AzBotServiceHostSetting', 'Initialize-AzBotServicePrepareDeploy', 'New-AzBotService', 'New-AzBotServiceDirectLineKey', 'Publish-AzBotServiceApp', 'Remove-AzBotService', 'Update-AzBotService', '*' - AliasesToExport = '*' + FunctionsToExport = 'Export-AzBotServiceApp', 'Get-AzBotService', 'Get-AzBotServiceHostSetting', 'Initialize-AzBotServicePrepareDeploy', 'New-AzBotService', 'New-AzBotServiceDirectLineKey', 'Publish-AzBotServiceApp', 'Remove-AzBotService', 'Update-AzBotService' PrivateData = @{ PSData = @{ Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'BotService' diff --git a/generated/BotService/BotService.Autorest/Properties/AssemblyInfo.cs b/generated/BotService/BotService.Autorest/Properties/AssemblyInfo.cs index 25dead294cfa..318652415c99 100644 --- a/generated/BotService/BotService.Autorest/Properties/AssemblyInfo.cs +++ b/generated/BotService/BotService.Autorest/Properties/AssemblyInfo.cs @@ -1,28 +1,26 @@ -// ---------------------------------------------------------------------------------- -// -// Copyright Microsoft Corporation -// Licensed under the Apache License, Version 2.0 (the "License"); +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the Apache License, Version 2.0 (the ""License""); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, +// distributed under the License is distributed on an ""AS IS"" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// ---------------------------------------------------------------------------------- +// Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code +// is regenerated. using System; using System.Reflection; +using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -[assembly: AssemblyTitle("Microsoft Azure Powershell - BotService")] -[assembly: AssemblyCompany(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCompany)] -[assembly: AssemblyProduct(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyProduct)] -[assembly: AssemblyCopyright(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCopyright)] - -[assembly: ComVisible(false)] -[assembly: CLSCompliant(false)] -[assembly: Guid("d7e093c8-48ce-469b-a28c-2918f84b8746")] -[assembly: AssemblyVersion("0.5.2")] -[assembly: AssemblyFileVersion("0.5.2")] +[assembly: System.Reflection.AssemblyCompanyAttribute("Microsoft")] +[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")] +[assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")] +[assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - BotService")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("0.5.2")] +[assembly: System.Reflection.AssemblyVersionAttribute("0.5.2")] +[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)] +[assembly: System.CLSCompliantAttribute(false)] diff --git a/generated/BotService/BotService.Autorest/check-dependencies.ps1 b/generated/BotService/BotService.Autorest/check-dependencies.ps1 index c29591c7bfe1..90ca9867ae40 100644 --- a/generated/BotService/BotService.Autorest/check-dependencies.ps1 +++ b/generated/BotService/BotService.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/BotService/BotService.Autorest/exports/Export-AzBotServiceApp.ps1 b/generated/BotService/BotService.Autorest/exports/Export-AzBotServiceApp.ps1 index ab22ce451755..86d168872fc9 100644 --- a/generated/BotService/BotService.Autorest/exports/Export-AzBotServiceApp.ps1 +++ b/generated/BotService/BotService.Autorest/exports/Export-AzBotServiceApp.ps1 @@ -23,12 +23,12 @@ Returns a BotService specified by the parameters. Export-AzBotServiceApp -ResourceGroupName youriBotTest -name youriechobottest .Outputs -Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot +Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot .Link https://learn.microsoft.com/powershell/module/az.botservice/export-azbotserviceapp #> function Export-AzBotServiceApp { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter()] @@ -111,6 +111,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.BotService.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() @@ -132,9 +141,7 @@ begin { $mapping = @{ __AllParameterSets = 'Az.BotService.custom\Export-AzBotServiceApp'; } - if (('__AllParameterSets') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('__AllParameterSets') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -148,6 +155,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/BotService/BotService.Autorest/exports/Get-AzBotService.ps1 b/generated/BotService/BotService.Autorest/exports/Get-AzBotService.ps1 index 84cc1c7f5610..acba39ab4807 100644 --- a/generated/BotService/BotService.Autorest/exports/Get-AzBotService.ps1 +++ b/generated/BotService/BotService.Autorest/exports/Get-AzBotService.ps1 @@ -31,14 +31,14 @@ Get-AzBotService -ResourceGroupName botTest-rg .Inputs Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot +Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot .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 - [ChannelName ]: The name of the Channel resource. + [ChannelName ]: The name of the Channel resource. [ConnectionName ]: The name of the Bot Service Connection Setting resource. [Id ]: Resource identity path [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource @@ -49,7 +49,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.botservice/get-azbotservice #> function Get-AzBotService { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot])] [CmdletBinding(DefaultParameterSetName='List1', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -79,7 +79,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -138,6 +137,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -162,9 +170,7 @@ begin { List = 'Az.BotService.private\Get-AzBotService_List'; List1 = 'Az.BotService.private\Get-AzBotService_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.BotService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -178,6 +184,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/BotService/BotService.Autorest/exports/Get-AzBotServiceHostSetting.ps1 b/generated/BotService/BotService.Autorest/exports/Get-AzBotServiceHostSetting.ps1 index 72b3b5316108..3ba7745c82fe 100644 --- a/generated/BotService/BotService.Autorest/exports/Get-AzBotServiceHostSetting.ps1 +++ b/generated/BotService/BotService.Autorest/exports/Get-AzBotServiceHostSetting.ps1 @@ -23,12 +23,12 @@ Get per subscription settings needed to host bot in compute resource such as Azu Get-AzBotServiceHostSetting .Outputs -Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IHostSettingsResponse +Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IHostSettingsResponse .Link https://learn.microsoft.com/powershell/module/az.botservice/get-azbotservicehostsetting #> function Get-AzBotServiceHostSetting { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IHostSettingsResponse])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IHostSettingsResponse])] [CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] param( [Parameter()] @@ -94,6 +94,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -115,9 +124,7 @@ begin { $mapping = @{ Get = 'Az.BotService.private\Get-AzBotServiceHostSetting_Get'; } - if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.BotService.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 { @@ -131,6 +138,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/BotService/BotService.Autorest/exports/Initialize-AzBotServicePrepareDeploy.ps1 b/generated/BotService/BotService.Autorest/exports/Initialize-AzBotServicePrepareDeploy.ps1 index 285ce522a3ca..9d1028303b55 100644 --- a/generated/BotService/BotService.Autorest/exports/Initialize-AzBotServicePrepareDeploy.ps1 +++ b/generated/BotService/BotService.Autorest/exports/Initialize-AzBotServicePrepareDeploy.ps1 @@ -23,12 +23,12 @@ Returns a BotService specified by the parameters. Initialize-AzBotServicePrepareDeploy -CodeDir D:\zips\MyEchoBot -ProjFileName MyEchoBot.csproj .Outputs -Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot +Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot .Link https://learn.microsoft.com/powershell/module/az.botservice/initialize-azbotservicepreparedeploy #> function Initialize-AzBotServicePrepareDeploy { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter()] @@ -111,6 +111,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.BotService.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() @@ -132,9 +141,7 @@ begin { $mapping = @{ __AllParameterSets = 'Az.BotService.custom\Initialize-AzBotServicePrepareDeploy'; } - if (('__AllParameterSets') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('__AllParameterSets') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -148,6 +155,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/BotService/BotService.Autorest/exports/New-AzBotService.ps1 b/generated/BotService/BotService.Autorest/exports/New-AzBotService.ps1 index a43e7694205e..6dea3372221c 100644 --- a/generated/BotService/BotService.Autorest/exports/New-AzBotService.ps1 +++ b/generated/BotService/BotService.Autorest/exports/New-AzBotService.ps1 @@ -25,12 +25,12 @@ New-AzBotService -resourcegroupname BotTest-rg -name BotTest1 -ApplicationId "af New-AzBotService -resourcegroupname BotTest-rg -name BotTest2 -ApplicationId "b1ab1727-0465-4255-a1bb-976210af972c" -Location global -Sku F0 -Description "123134" -Webapp .Outputs -Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot +Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot .Link https://learn.microsoft.com/powershell/module/az.botservice/new-azbotservice #> function New-AzBotService { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot])] [CmdletBinding(DefaultParameterSetName='Registration', PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -183,6 +183,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.BotService.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() @@ -205,9 +214,7 @@ begin { Registration = 'Az.BotService.custom\New-AzBotService'; WebApp = 'Az.BotService.custom\New-AzBotService'; } - if (('Registration', 'WebApp') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Registration', 'WebApp') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -221,6 +228,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/BotService/BotService.Autorest/exports/New-AzBotServiceDirectLineKey.ps1 b/generated/BotService/BotService.Autorest/exports/New-AzBotServiceDirectLineKey.ps1 index d77f61a18ea4..90b6b353f01d 100644 --- a/generated/BotService/BotService.Autorest/exports/New-AzBotServiceDirectLineKey.ps1 +++ b/generated/BotService/BotService.Autorest/exports/New-AzBotServiceDirectLineKey.ps1 @@ -23,18 +23,18 @@ Regenerates secret keys and returns them for the DirectLine Channel of a particu New-AzBotServiceDirectLineKey -ChannelName 'DirectLineChannel' -ResourceGroupName botTest-rg -ResourceName botTest1 -Key key1 -SiteName siteName .Outputs -Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannel +Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannel .Link https://learn.microsoft.com/powershell/module/az.botservice/new-azbotservicedirectlinekey #> function New-AzBotServiceDirectLineKey { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannel])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannel])] [CmdletBinding(DefaultParameterSetName='RegenerateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.RegenerateKeysChannelName])] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("WebChatChannel", "DirectLineChannel")] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.RegenerateKeysChannelName] + [System.String] # The name of the Channel resource for which keys are to be regenerated. ${ChannelName}, @@ -57,19 +57,31 @@ param( # Azure Subscription ID. ${SubscriptionId}, - [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Key])] + [Parameter(ParameterSetName='RegenerateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("key1", "key2")] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Key] + [System.String] # Determines which key is to be regenerated ${Key}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='RegenerateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # The site name ${SiteName}, + [Parameter(ParameterSetName='RegenerateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] + [System.String] + # Path of Json file supplied to the Regenerate operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='RegenerateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] + [System.String] + # Json string supplied to the Regenerate operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -126,6 +138,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.BotService.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() @@ -146,10 +167,10 @@ begin { $mapping = @{ RegenerateExpanded = 'Az.BotService.private\New-AzBotServiceDirectLineKey_RegenerateExpanded'; + RegenerateViaJsonFilePath = 'Az.BotService.private\New-AzBotServiceDirectLineKey_RegenerateViaJsonFilePath'; + RegenerateViaJsonString = 'Az.BotService.private\New-AzBotServiceDirectLineKey_RegenerateViaJsonString'; } - if (('RegenerateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('RegenerateExpanded', 'RegenerateViaJsonFilePath', 'RegenerateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -163,6 +184,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/BotService/BotService.Autorest/exports/ProxyCmdletDefinitions.ps1 b/generated/BotService/BotService.Autorest/exports/ProxyCmdletDefinitions.ps1 index 8a8ecf3ddafe..e2b1c9afad4e 100644 --- a/generated/BotService/BotService.Autorest/exports/ProxyCmdletDefinitions.ps1 +++ b/generated/BotService/BotService.Autorest/exports/ProxyCmdletDefinitions.ps1 @@ -23,12 +23,12 @@ Get per subscription settings needed to host bot in compute resource such as Azu Get-AzBotServiceHostSetting .Outputs -Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IHostSettingsResponse +Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IHostSettingsResponse .Link https://learn.microsoft.com/powershell/module/az.botservice/get-azbotservicehostsetting #> function Get-AzBotServiceHostSetting { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IHostSettingsResponse])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IHostSettingsResponse])] [CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] param( [Parameter()] @@ -94,6 +94,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -115,9 +124,7 @@ begin { $mapping = @{ Get = 'Az.BotService.private\Get-AzBotServiceHostSetting_Get'; } - if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.BotService.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 { @@ -131,6 +138,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -191,14 +201,14 @@ Get-AzBotService -ResourceGroupName botTest-rg .Inputs Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot +Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot .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 - [ChannelName ]: The name of the Channel resource. + [ChannelName ]: The name of the Channel resource. [ConnectionName ]: The name of the Bot Service Connection Setting resource. [Id ]: Resource identity path [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource @@ -209,7 +219,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.botservice/get-azbotservice #> function Get-AzBotService { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot])] [CmdletBinding(DefaultParameterSetName='List1', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -239,7 +249,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -298,6 +307,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.BotService.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() @@ -322,9 +340,7 @@ begin { List = 'Az.BotService.private\Get-AzBotService_List'; List1 = 'Az.BotService.private\Get-AzBotService_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.BotService.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 { @@ -338,6 +354,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) @@ -390,18 +409,18 @@ Regenerates secret keys and returns them for the DirectLine Channel of a particu New-AzBotServiceDirectLineKey -ChannelName 'DirectLineChannel' -ResourceGroupName botTest-rg -ResourceName botTest1 -Key key1 -SiteName siteName .Outputs -Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannel +Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannel .Link https://learn.microsoft.com/powershell/module/az.botservice/new-azbotservicedirectlinekey #> function New-AzBotServiceDirectLineKey { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannel])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannel])] [CmdletBinding(DefaultParameterSetName='RegenerateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.RegenerateKeysChannelName])] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("WebChatChannel", "DirectLineChannel")] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.RegenerateKeysChannelName] + [System.String] # The name of the Channel resource for which keys are to be regenerated. ${ChannelName}, @@ -424,19 +443,31 @@ param( # Azure Subscription ID. ${SubscriptionId}, - [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Key])] + [Parameter(ParameterSetName='RegenerateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("key1", "key2")] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Key] + [System.String] # Determines which key is to be regenerated ${Key}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='RegenerateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # The site name ${SiteName}, + [Parameter(ParameterSetName='RegenerateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] + [System.String] + # Path of Json file supplied to the Regenerate operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='RegenerateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] + [System.String] + # Json string supplied to the Regenerate operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -493,6 +524,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.BotService.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() @@ -513,10 +553,10 @@ begin { $mapping = @{ RegenerateExpanded = 'Az.BotService.private\New-AzBotServiceDirectLineKey_RegenerateExpanded'; + RegenerateViaJsonFilePath = 'Az.BotService.private\New-AzBotServiceDirectLineKey_RegenerateViaJsonFilePath'; + RegenerateViaJsonString = 'Az.BotService.private\New-AzBotServiceDirectLineKey_RegenerateViaJsonString'; } - if (('RegenerateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('RegenerateExpanded', 'RegenerateViaJsonFilePath', 'RegenerateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -530,6 +570,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) @@ -594,7 +637,7 @@ 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 - [ChannelName ]: The name of the Channel resource. + [ChannelName ]: The name of the Channel resource. [ConnectionName ]: The name of the Bot Service Connection Setting resource. [Id ]: Resource identity path [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource @@ -632,7 +675,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -697,6 +739,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.BotService.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() @@ -719,9 +770,7 @@ begin { Delete = 'Az.BotService.private\Remove-AzBotService_Delete'; DeleteViaIdentity = 'Az.BotService.private\Remove-AzBotService_DeleteViaIdentity'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.BotService.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 { @@ -735,6 +784,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) @@ -780,9 +832,9 @@ end { <# .Synopsis -Updates a Bot Service +update a Bot Service .Description -Updates a Bot Service +update a Bot Service .Example Update-AzBotService -Name 'youri-apptest' -ResourceGroupName 'youriBotTest' -kind Bot .Example @@ -792,14 +844,14 @@ Update-AzBotService -InputObject $getAzbot -kind sdk .Inputs Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot +Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot .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 - [ChannelName ]: The name of the Channel resource. + [ChannelName ]: The name of the Channel resource. [ConnectionName ]: The name of the Bot Service Connection Setting resource. [Id ]: Resource identity path [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource @@ -810,10 +862,12 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.botservice/update-azbotservice #> function Update-AzBotService { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Alias('BotName')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')] [System.String] @@ -821,12 +875,16 @@ param( ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')] [System.String] # The name of the Bot resource group in the user subscription. ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -837,211 +895,233 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentity] # 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.BotService.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesAllSettings]))] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesAllSettings]))] [System.Collections.Hashtable] # Contains resource all settings defined as key/value pairs. ${AllSetting}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # The hint (e.g. # keyVault secret resourceId) on how to fetch the app secret ${AppPasswordHint}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # The CMK Url ${CmekKeyVaultUrl}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # The description of the bot ${Description}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # The Application Insights key ${DeveloperAppInsightKey}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # The Application Insights Api Key ${DeveloperAppInsightsApiKey}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # The Application Insights App Id ${DeveloperAppInsightsApplicationId}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.Management.Automation.SwitchParameter] # Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. ${DisableLocalAuth}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # The Name of the bot ${DisplayName}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # The bot's endpoint ${Endpoint}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # Entity Tag ${Etag}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # The Icon Url of the bot ${IconUrl}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.Management.Automation.SwitchParameter] # Whether Cmek is enabled ${IsCmekEnabled}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.Management.Automation.SwitchParameter] # Whether the bot is streaming supported ${IsStreamingSupported}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Kind])] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("sdk", "designer", "bot", "function", "azurebot")] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Kind] + [System.String] # Required. # Gets or sets the Kind of the resource. ${Kind}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # Specifies the location of the resource. ${Location}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String[]] # Collection of LUIS App Ids ${LuisAppId}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # The LUIS Key ${LuisKey}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # The bot's manifest url ${ManifestUrl}, - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] - [System.String] - # Microsoft App Id for the bot - ${MsaAppId}, - - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # Microsoft App Managed Identity Resource Id for the bot ${MsaAppMsiResourceId}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("UserAssignedMSI", "SingleTenant", "MultiTenant")] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] - # Microsoft App Tenant Id for the bot - ${MsaAppTenantId}, - - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.MsaAppType])] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.MsaAppType] # Microsoft App Type for the bot ${MsaAppType}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # The hint to browser (e.g. # protocol handler) on how to open the bot for authoring ${OpenWithHint}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesParameters]))] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesParameters]))] [System.Collections.Hashtable] # Contains resource parameters defined as key/value pairs. ${Parameter}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PublicNetworkAccess])] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("Enabled", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PublicNetworkAccess] + [System.String] # Whether the bot is in an isolated network ${PublicNetworkAccess}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # Publishing credentials of the resource ${PublishingCredentials}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # The channel schema transformation version for the bot ${SchemaTransformationVersion}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName])] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("F0", "S1")] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName] + [System.String] # The sku name ${SkuName}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # The storage resourceId for the bot ${StorageResourceId}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceTags]))] [System.Collections.Hashtable] # Contains resource tags defined as key/value pairs. ${Tag}, - [Parameter()] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] - # The Tenant Id for the bot - ${TenantId}, + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] @@ -1099,6 +1179,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.BotService.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() @@ -1120,10 +1209,10 @@ begin { $mapping = @{ UpdateExpanded = 'Az.BotService.private\Update-AzBotService_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.BotService.private\Update-AzBotService_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.BotService.private\Update-AzBotService_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.BotService.private\Update-AzBotService_UpdateViaJsonString'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.BotService.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 { @@ -1137,6 +1226,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) @@ -1189,12 +1281,12 @@ Returns a BotService specified by the parameters. Export-AzBotServiceApp -ResourceGroupName youriBotTest -name youriechobottest .Outputs -Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot +Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot .Link https://learn.microsoft.com/powershell/module/az.botservice/export-azbotserviceapp #> function Export-AzBotServiceApp { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter()] @@ -1277,6 +1369,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.BotService.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() @@ -1298,9 +1399,7 @@ begin { $mapping = @{ __AllParameterSets = 'Az.BotService.custom\Export-AzBotServiceApp'; } - if (('__AllParameterSets') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('__AllParameterSets') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -1314,6 +1413,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) @@ -1366,12 +1468,12 @@ Returns a BotService specified by the parameters. Initialize-AzBotServicePrepareDeploy -CodeDir D:\zips\MyEchoBot -ProjFileName MyEchoBot.csproj .Outputs -Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot +Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot .Link https://learn.microsoft.com/powershell/module/az.botservice/initialize-azbotservicepreparedeploy #> function Initialize-AzBotServicePrepareDeploy { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter()] @@ -1454,6 +1556,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.BotService.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() @@ -1475,9 +1586,7 @@ begin { $mapping = @{ __AllParameterSets = 'Az.BotService.custom\Initialize-AzBotServicePrepareDeploy'; } - if (('__AllParameterSets') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('__AllParameterSets') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -1491,6 +1600,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) @@ -1545,12 +1657,12 @@ New-AzBotService -resourcegroupname BotTest-rg -name BotTest1 -ApplicationId "af New-AzBotService -resourcegroupname BotTest-rg -name BotTest2 -ApplicationId "b1ab1727-0465-4255-a1bb-976210af972c" -Location global -Sku F0 -Description "123134" -Webapp .Outputs -Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot +Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot .Link https://learn.microsoft.com/powershell/module/az.botservice/new-azbotservice #> function New-AzBotService { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot])] [CmdletBinding(DefaultParameterSetName='Registration', PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -1703,6 +1815,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.BotService.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() @@ -1725,9 +1846,7 @@ begin { Registration = 'Az.BotService.custom\New-AzBotService'; WebApp = 'Az.BotService.custom\New-AzBotService'; } - if (('Registration', 'WebApp') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Registration', 'WebApp') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -1741,6 +1860,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) @@ -1827,6 +1949,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.BotService.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() @@ -1855,6 +1986,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/BotService/BotService.Autorest/exports/Publish-AzBotServiceApp.ps1 b/generated/BotService/BotService.Autorest/exports/Publish-AzBotServiceApp.ps1 index 75f66a9606a4..9924ae7ca0b9 100644 --- a/generated/BotService/BotService.Autorest/exports/Publish-AzBotServiceApp.ps1 +++ b/generated/BotService/BotService.Autorest/exports/Publish-AzBotServiceApp.ps1 @@ -57,6 +57,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.BotService.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() @@ -85,6 +94,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/BotService/BotService.Autorest/exports/Remove-AzBotService.ps1 b/generated/BotService/BotService.Autorest/exports/Remove-AzBotService.ps1 index 685c46fd0009..b3614f5be32c 100644 --- a/generated/BotService/BotService.Autorest/exports/Remove-AzBotService.ps1 +++ b/generated/BotService/BotService.Autorest/exports/Remove-AzBotService.ps1 @@ -35,7 +35,7 @@ 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 - [ChannelName ]: The name of the Channel resource. + [ChannelName ]: The name of the Channel resource. [ConnectionName ]: The name of the Bot Service Connection Setting resource. [Id ]: Resource identity path [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource @@ -73,7 +73,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -138,6 +137,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.BotService.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() @@ -160,9 +168,7 @@ begin { Delete = 'Az.BotService.private\Remove-AzBotService_Delete'; DeleteViaIdentity = 'Az.BotService.private\Remove-AzBotService_DeleteViaIdentity'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.BotService.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 { @@ -176,6 +182,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/BotService/BotService.Autorest/exports/Update-AzBotService.ps1 b/generated/BotService/BotService.Autorest/exports/Update-AzBotService.ps1 index 06d47e2818ef..7f9027eabd6c 100644 --- a/generated/BotService/BotService.Autorest/exports/Update-AzBotService.ps1 +++ b/generated/BotService/BotService.Autorest/exports/Update-AzBotService.ps1 @@ -16,9 +16,9 @@ <# .Synopsis -Updates a Bot Service +update a Bot Service .Description -Updates a Bot Service +update a Bot Service .Example Update-AzBotService -Name 'youri-apptest' -ResourceGroupName 'youriBotTest' -kind Bot .Example @@ -28,14 +28,14 @@ Update-AzBotService -InputObject $getAzbot -kind sdk .Inputs Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot +Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot .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 - [ChannelName ]: The name of the Channel resource. + [ChannelName ]: The name of the Channel resource. [ConnectionName ]: The name of the Bot Service Connection Setting resource. [Id ]: Resource identity path [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource @@ -46,10 +46,12 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.botservice/update-azbotservice #> function Update-AzBotService { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Alias('BotName')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')] [System.String] @@ -57,12 +59,16 @@ param( ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')] [System.String] # The name of the Bot resource group in the user subscription. ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -73,211 +79,233 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentity] # 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.BotService.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesAllSettings]))] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesAllSettings]))] [System.Collections.Hashtable] # Contains resource all settings defined as key/value pairs. ${AllSetting}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # The hint (e.g. # keyVault secret resourceId) on how to fetch the app secret ${AppPasswordHint}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # The CMK Url ${CmekKeyVaultUrl}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # The description of the bot ${Description}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # The Application Insights key ${DeveloperAppInsightKey}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # The Application Insights Api Key ${DeveloperAppInsightsApiKey}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # The Application Insights App Id ${DeveloperAppInsightsApplicationId}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.Management.Automation.SwitchParameter] # Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. ${DisableLocalAuth}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # The Name of the bot ${DisplayName}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # The bot's endpoint ${Endpoint}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # Entity Tag ${Etag}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # The Icon Url of the bot ${IconUrl}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.Management.Automation.SwitchParameter] # Whether Cmek is enabled ${IsCmekEnabled}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.Management.Automation.SwitchParameter] # Whether the bot is streaming supported ${IsStreamingSupported}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Kind])] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("sdk", "designer", "bot", "function", "azurebot")] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Kind] + [System.String] # Required. # Gets or sets the Kind of the resource. ${Kind}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # Specifies the location of the resource. ${Location}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String[]] # Collection of LUIS App Ids ${LuisAppId}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # The LUIS Key ${LuisKey}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # The bot's manifest url ${ManifestUrl}, - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] - [System.String] - # Microsoft App Id for the bot - ${MsaAppId}, - - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # Microsoft App Managed Identity Resource Id for the bot ${MsaAppMsiResourceId}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("UserAssignedMSI", "SingleTenant", "MultiTenant")] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] - # Microsoft App Tenant Id for the bot - ${MsaAppTenantId}, - - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.MsaAppType])] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.MsaAppType] # Microsoft App Type for the bot ${MsaAppType}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # The hint to browser (e.g. # protocol handler) on how to open the bot for authoring ${OpenWithHint}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesParameters]))] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesParameters]))] [System.Collections.Hashtable] # Contains resource parameters defined as key/value pairs. ${Parameter}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PublicNetworkAccess])] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("Enabled", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PublicNetworkAccess] + [System.String] # Whether the bot is in an isolated network ${PublicNetworkAccess}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # Publishing credentials of the resource ${PublishingCredentials}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # The channel schema transformation version for the bot ${SchemaTransformationVersion}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName])] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("F0", "S1")] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName] + [System.String] # The sku name ${SkuName}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # The storage resourceId for the bot ${StorageResourceId}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceTags]))] [System.Collections.Hashtable] # Contains resource tags defined as key/value pairs. ${Tag}, - [Parameter()] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] - # The Tenant Id for the bot - ${TenantId}, + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] @@ -335,6 +363,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.BotService.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() @@ -356,10 +393,10 @@ begin { $mapping = @{ UpdateExpanded = 'Az.BotService.private\Update-AzBotService_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.BotService.private\Update-AzBotService_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.BotService.private\Update-AzBotService_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.BotService.private\Update-AzBotService_UpdateViaJsonString'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.BotService.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 { @@ -373,6 +410,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/BotService/BotService.Autorest/generate-info.json b/generated/BotService/BotService.Autorest/generate-info.json index 563fd16aa762..6a675ba81175 100644 --- a/generated/BotService/BotService.Autorest/generate-info.json +++ b/generated/BotService/BotService.Autorest/generate-info.json @@ -1,3 +1,3 @@ { - "generate_Id": "913093fe-4d29-4b55-9f9e-89026b9c664b" + "generate_Id": "9cf6877d-65bb-40b1-a43f-aa4d04107caf" } diff --git a/generated/BotService/BotService.Autorest/generated/Module.cs b/generated/BotService/BotService.Autorest/generated/Module.cs index 546388d4b5d6..6b747330b4d3 100644 --- a/generated/BotService/BotService.Autorest/generated/Module.cs +++ b/generated/BotService/BotService.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.BotService.Module _instance; + /// the ISendAsync pipeline instance private Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.HttpPipeline _pipeline; /// the ISendAsync pipeline instance (when proxy is enabled) private Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.HttpPipeline _pipelineWithProxy; + private static readonly global::System.Object _singletonLock = new global::System.Object(); + public bool _useProxy = false; public global::System.Net.WebProxy _webProxy = new global::System.Net.WebProxy(); @@ -56,11 +64,8 @@ public partial class Module /// The delegate to get the telemetry info. public GetTelemetryInfoDelegate GetTelemetryInfo { get; set; } - /// Backing field for property. - private static Microsoft.Azure.PowerShell.Cmdlets.BotService.Module _instance; - /// the singleton of this module class - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Module Instance => Microsoft.Azure.PowerShell.Cmdlets.BotService.Module._instance?? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Module._instance = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Module()); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService"; @@ -125,9 +130,17 @@ public Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.HttpPipeline Create /// 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/BotService/BotService.Autorest/generated/api/BotService.cs b/generated/BotService/BotService.Autorest/generated/api/BotService.cs index 5df477f96a35..e6111cb2a198 100644 --- a/generated/BotService/BotService.Autorest/generated/api/BotService.cs +++ b/generated/BotService/BotService.Autorest/generated/api/BotService.cs @@ -15,10 +15,10 @@ public partial class BotService { /// Register a new Auth Connection for a Bot Service + /// Azure Subscription ID. /// The name of the Bot resource group in the user subscription. /// The name of the Bot resource. /// The name of the Bot Service Connection Setting resource. - /// Azure Subscription ID. /// The parameters to provide for creating the Connection Setting. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns 201 (Created). @@ -26,10 +26,11 @@ public partial class BotService /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 BotConnectionCreate(string resourceGroupName, string resourceName, string connectionName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSetting 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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BotConnectionCreate(string subscriptionId, string resourceGroupName, string resourceName, string connectionName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSetting 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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-06-15-preview"; // Constant Parameters @@ -58,11 +59,11 @@ public partial class BotService await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BotConnectionCreate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + await this.BotConnectionCreate_Call (request, onOk,onCreated,onDefault,eventListener,sender); } } @@ -75,10 +76,11 @@ public partial class BotService /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 BotConnectionCreateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSetting 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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BotConnectionCreateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSetting 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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-06-15-preview"; // Constant Parameters @@ -93,10 +95,70 @@ public partial class BotService } // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var resourceName = _match.Groups["resourceName"].Value; var connectionName = _match.Groups["connectionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.BotService/botServices/" + + resourceName + + "/connections/" + + connectionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BotConnectionCreate_Call (request, onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Register a new Auth Connection for a Bot Service + /// + /// The parameters to provide for creating the Connection Setting. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 BotConnectionCreateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSetting body, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2022-06-15-preview"; + // 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.BotService/botServices/(?[^/]+)/connections/(?[^/]+)$", 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.BotService/botServices/{resourceName}/connections/{connectionName}'"); + } + + // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var resourceName = _match.Groups["resourceName"].Value; + var connectionName = _match.Groups["connectionName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -111,6 +173,58 @@ public partial class BotService + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.BotConnectionCreateWithResult_Call (request, eventListener,sender); + } + } + + /// Register a new Auth Connection for a Bot Service + /// Azure Subscription ID. + /// The name of the Bot resource group in the user subscription. + /// The name of the Bot resource. + /// The name of the Bot Service Connection Setting resource. + /// Json string supplied to the BotConnectionCreate 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.BotService.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 BotConnectionCreateViaJsonString(string subscriptionId, string resourceGroupName, string resourceName, string connectionName, 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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-06-15-preview"; + // 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.BotService/botServices/" + + global::System.Uri.EscapeDataString(resourceName) + + "/connections/" + + global::System.Uri.EscapeDataString(connectionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } // generate request object @@ -120,15 +234,180 @@ public partial class BotService await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BotConnectionCreate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + await this.BotConnectionCreate_Call (request, onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Register a new Auth Connection for a Bot Service + /// Azure Subscription ID. + /// The name of the Bot resource group in the user subscription. + /// The name of the Bot resource. + /// The name of the Bot Service Connection Setting resource. + /// Json string supplied to the BotConnectionCreate operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 BotConnectionCreateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string resourceName, string connectionName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-06-15-preview"; + // 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.BotService/botServices/" + + global::System.Uri.EscapeDataString(resourceName) + + "/connections/" + + global::System.Uri.EscapeDataString(connectionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.BotConnectionCreateWithResult_Call (request, eventListener,sender); + } + } + + /// Register a new Auth Connection for a Bot Service + /// Azure Subscription ID. + /// The name of the Bot resource group in the user subscription. + /// The name of the Bot resource. + /// The name of the Bot Service Connection Setting resource. + /// The parameters to provide for creating the Connection Setting. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 BotConnectionCreateWithResult(string subscriptionId, string resourceGroupName, string resourceName, string connectionName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSetting body, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2022-06-15-preview"; + // 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.BotService/botServices/" + + global::System.Uri.EscapeDataString(resourceName) + + "/connections/" + + global::System.Uri.EscapeDataString(connectionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.BotConnectionCreateWithResult_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.BotService.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 BotConnectionCreateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ConnectionSetting.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ConnectionSetting.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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.BotService.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). @@ -139,7 +418,7 @@ public partial class BotService /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task BotConnectionCreate_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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task BotConnectionCreate_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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -150,6 +429,7 @@ public partial class BotService await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -157,19 +437,19 @@ public partial class BotService case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ConnectionSetting.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ConnectionSetting.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } case global::System.Net.HttpStatusCode.Created: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ConnectionSetting.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ConnectionSetting.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -188,42 +468,42 @@ public partial class BotService /// Validation method for method. Call this like the actual call, but you will get validation /// events back. /// + /// Azure Subscription ID. /// The name of the Bot resource group in the user subscription. /// The name of the Bot resource. /// The name of the Bot Service Connection Setting resource. - /// Azure Subscription ID. /// The parameters to provide for creating the Connection 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 BotConnectionCreate_Validate(string resourceGroupName, string resourceName, string connectionName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSetting body, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task BotConnectionCreate_Validate(string subscriptionId, string resourceGroupName, string resourceName, string connectionName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSetting body, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,2); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,64); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); await eventListener.AssertNotNull(nameof(resourceName),resourceName); await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,2); await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,64); - await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + await eventListener.AssertRegEx(nameof(resourceName), resourceName, @"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); await eventListener.AssertNotNull(nameof(connectionName),connectionName); await eventListener.AssertMinimumLength(nameof(connectionName),connectionName,2); await eventListener.AssertMaximumLength(nameof(connectionName),connectionName,64); - await eventListener.AssertRegEx(nameof(connectionName),connectionName,@"^[a-zA-Z0-9][\sa-zA-Z0-9_.-]*$"); - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(connectionName), connectionName, @"^[a-zA-Z0-9][\sa-zA-Z0-9_.-]*$"); await eventListener.AssertNotNull(nameof(body), body); await eventListener.AssertObjectIsValid(nameof(body), body); } } /// Deletes a Connection Setting registration for a Bot Service + /// Azure Subscription ID. /// The name of the Bot resource group in the user subscription. /// The name of the Bot resource. /// The name of the Bot Service Connection Setting resource. - /// Azure Subscription ID. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled @@ -233,7 +513,7 @@ public partial class BotService /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task BotConnectionDelete(string resourceGroupName, string resourceName, string connectionName, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BotConnectionDelete(string subscriptionId, string resourceGroupName, string resourceName, string connectionName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { var apiVersion = @"2022-06-15-preview"; // Constant Parameters @@ -262,7 +542,7 @@ public partial class BotService await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BotConnectionDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.BotConnectionDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } @@ -277,7 +557,7 @@ public partial class BotService /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task BotConnectionDeleteViaIdentity(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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BotConnectionDeleteViaIdentity(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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { var apiVersion = @"2022-06-15-preview"; // Constant Parameters @@ -292,10 +572,10 @@ public partial class BotService } // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var resourceName = _match.Groups["resourceName"].Value; var connectionName = _match.Groups["connectionName"].Value; - var subscriptionId = _match.Groups["subscriptionId"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -319,11 +599,11 @@ public partial class BotService await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BotConnectionDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.BotConnectionDelete_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). @@ -334,7 +614,7 @@ public partial class BotService /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task BotConnectionDelete_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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task BotConnectionDelete_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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -345,6 +625,7 @@ public partial class BotService await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -364,7 +645,7 @@ public partial class BotService default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -383,39 +664,39 @@ public partial class BotService /// Validation method for method. Call this like the actual call, but you will get validation /// events back. /// + /// Azure Subscription ID. /// The name of the Bot resource group in the user subscription. /// The name of the Bot resource. /// The name of the Bot Service Connection Setting resource. - /// Azure Subscription ID. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task BotConnectionDelete_Validate(string resourceGroupName, string resourceName, string connectionName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task BotConnectionDelete_Validate(string subscriptionId, string resourceGroupName, string resourceName, string connectionName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,2); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,64); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); await eventListener.AssertNotNull(nameof(resourceName),resourceName); await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,2); await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,64); - await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + await eventListener.AssertRegEx(nameof(resourceName), resourceName, @"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); await eventListener.AssertNotNull(nameof(connectionName),connectionName); await eventListener.AssertMinimumLength(nameof(connectionName),connectionName,2); await eventListener.AssertMaximumLength(nameof(connectionName),connectionName,64); - await eventListener.AssertRegEx(nameof(connectionName),connectionName,@"^[a-zA-Z0-9][\sa-zA-Z0-9_.-]*$"); - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(connectionName), connectionName, @"^[a-zA-Z0-9][\sa-zA-Z0-9_.-]*$"); } } /// Get a Connection Setting registration for a Bot Service + /// Azure Subscription ID. /// The name of the Bot resource group in the user subscription. /// The name of the Bot resource. /// The name of the Bot Service Connection Setting resource. - /// Azure Subscription ID. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -424,7 +705,7 @@ public partial class BotService /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task BotConnectionGet(string resourceGroupName, string resourceName, string connectionName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BotConnectionGet(string subscriptionId, string resourceGroupName, string resourceName, string connectionName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { var apiVersion = @"2022-06-15-preview"; // Constant Parameters @@ -453,7 +734,7 @@ public partial class BotService await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BotConnectionGet_Call(request,onOk,onDefault,eventListener,sender); + await this.BotConnectionGet_Call (request, onOk,onDefault,eventListener,sender); } } @@ -467,7 +748,7 @@ public partial class BotService /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task BotConnectionGetViaIdentity(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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BotConnectionGetViaIdentity(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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { var apiVersion = @"2022-06-15-preview"; // Constant Parameters @@ -482,10 +763,10 @@ public partial class BotService } // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var resourceName = _match.Groups["resourceName"].Value; var connectionName = _match.Groups["connectionName"].Value; - var subscriptionId = _match.Groups["subscriptionId"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -509,45 +790,204 @@ public partial class BotService await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BotConnectionGet_Call(request,onOk,onDefault,eventListener,sender); + await this.BotConnectionGet_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 a Connection Setting registration for a Bot Service + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 BotConnectionGet_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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BotConnectionGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { + var apiVersion = @"2022-06-15-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("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.BotService/botServices/(?[^/]+)/connections/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService/botServices/{resourceName}/connections/{connectionName}'"); + } - switch ( _response.StatusCode ) + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var resourceName = _match.Groups["resourceName"].Value; + var connectionName = _match.Groups["connectionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.BotService/botServices/" + + resourceName + + "/connections/" + + connectionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.BotConnectionGetWithResult_Call (request, eventListener,sender); + } + } + + /// Get a Connection Setting registration for a Bot Service + /// Azure Subscription ID. + /// The name of the Bot resource group in the user subscription. + /// The name of the Bot resource. + /// The name of the Bot Service Connection Setting resource. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 BotConnectionGetWithResult(string subscriptionId, string resourceGroupName, string resourceName, string connectionName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-06-15-preview"; + // 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.BotService/botServices/" + + global::System.Uri.EscapeDataString(resourceName) + + "/connections/" + + global::System.Uri.EscapeDataString(connectionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.BotConnectionGetWithResult_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.BotService.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 BotConnectionGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ConnectionSetting.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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.BotService.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.BotService.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 BotConnectionGet_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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ConnectionSetting.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ConnectionSetting.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -566,40 +1006,40 @@ public partial class BotService /// Validation method for method. Call this like the actual call, but you will get validation /// events back. /// + /// Azure Subscription ID. /// The name of the Bot resource group in the user subscription. /// The name of the Bot resource. /// The name of the Bot Service Connection Setting resource. - /// Azure Subscription ID. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task BotConnectionGet_Validate(string resourceGroupName, string resourceName, string connectionName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task BotConnectionGet_Validate(string subscriptionId, string resourceGroupName, string resourceName, string connectionName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,2); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,64); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); await eventListener.AssertNotNull(nameof(resourceName),resourceName); await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,2); await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,64); - await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + await eventListener.AssertRegEx(nameof(resourceName), resourceName, @"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); await eventListener.AssertNotNull(nameof(connectionName),connectionName); await eventListener.AssertMinimumLength(nameof(connectionName),connectionName,2); await eventListener.AssertMaximumLength(nameof(connectionName),connectionName,64); - await eventListener.AssertRegEx(nameof(connectionName),connectionName,@"^[a-zA-Z0-9][\sa-zA-Z0-9_.-]*$"); - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(connectionName), connectionName, @"^[a-zA-Z0-9][\sa-zA-Z0-9_.-]*$"); } } /// /// Returns all the Connection Settings registered to a particular BotService resource /// + /// Azure Subscription ID. /// The name of the Bot resource group in the user subscription. /// The name of the Bot resource. - /// Azure Subscription ID. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -608,7 +1048,7 @@ public partial class BotService /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task BotConnectionListByBotService(string resourceGroupName, string resourceName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BotConnectionListByBotService(string subscriptionId, string resourceGroupName, string resourceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { var apiVersion = @"2022-06-15-preview"; // Constant Parameters @@ -636,7 +1076,7 @@ public partial class BotService await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BotConnectionListByBotService_Call(request,onOk,onDefault,eventListener,sender); + await this.BotConnectionListByBotService_Call (request, onOk,onDefault,eventListener,sender); } } @@ -652,7 +1092,7 @@ public partial class BotService /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task BotConnectionListByBotServiceViaIdentity(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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BotConnectionListByBotServiceViaIdentity(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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { var apiVersion = @"2022-06-15-preview"; // Constant Parameters @@ -667,9 +1107,9 @@ public partial class BotService } // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var resourceName = _match.Groups["resourceName"].Value; - var subscriptionId = _match.Groups["subscriptionId"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -692,11 +1132,171 @@ public partial class BotService await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BotConnectionListByBotService_Call(request,onOk,onDefault,eventListener,sender); + await this.BotConnectionListByBotService_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Returns all the Connection Settings registered to a particular BotService resource + /// + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 BotConnectionListByBotServiceViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-06-15-preview"; + // 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.BotService/botServices/(?[^/]+)/connections$", 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.BotService/botServices/{resourceName}/connections'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var resourceName = _match.Groups["resourceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.BotService/botServices/" + + resourceName + + "/connections" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.BotConnectionListByBotServiceWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Returns all the Connection Settings registered to a particular BotService resource + /// + /// Azure Subscription ID. + /// The name of the Bot resource group in the user subscription. + /// The name of the Bot resource. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 BotConnectionListByBotServiceWithResult(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-06-15-preview"; + // 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.BotService/botServices/" + + global::System.Uri.EscapeDataString(resourceName) + + "/connections" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.BotConnectionListByBotServiceWithResult_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.BotService.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 BotConnectionListByBotServiceWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ConnectionSettingResponseList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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.BotService.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 @@ -706,7 +1306,7 @@ public partial class BotService /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task BotConnectionListByBotService_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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task BotConnectionListByBotService_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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -717,6 +1317,7 @@ public partial class BotService await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -724,13 +1325,13 @@ public partial class BotService case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ConnectionSettingResponseList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ConnectionSettingResponseList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -749,26 +1350,26 @@ public partial class BotService /// Validation method for method. Call this like the actual call, but you will /// get validation events back. /// + /// Azure Subscription ID. /// The name of the Bot resource group in the user subscription. /// The name of the Bot resource. - /// Azure Subscription ID. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task BotConnectionListByBotService_Validate(string resourceGroupName, string resourceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task BotConnectionListByBotService_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,2); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,64); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); await eventListener.AssertNotNull(nameof(resourceName),resourceName); await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,2); await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,64); - await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(resourceName), resourceName, @"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); } } @@ -782,7 +1383,7 @@ public partial class BotService /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task BotConnectionListServiceProviders(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BotConnectionListServiceProviders(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { var apiVersion = @"2022-06-15-preview"; // Constant Parameters @@ -806,7 +1407,7 @@ public partial class BotService await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BotConnectionListServiceProviders_Call(request,onOk,onDefault,eventListener,sender); + await this.BotConnectionListServiceProviders_Call (request, onOk,onDefault,eventListener,sender); } } @@ -820,7 +1421,7 @@ public partial class BotService /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task BotConnectionListServiceProvidersViaIdentity(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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BotConnectionListServiceProvidersViaIdentity(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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { var apiVersion = @"2022-06-15-preview"; // Constant Parameters @@ -831,7 +1432,7 @@ public partial class BotService var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.BotService$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.BotService/listAuthServiceProviders'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.BotService'"); } // replace URI parameters with values from identity @@ -854,12 +1455,156 @@ public partial class BotService await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BotConnectionListServiceProviders_Call(request,onOk,onDefault,eventListener,sender); + await this.BotConnectionListServiceProviders_Call (request, onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. + /// Lists the available Service Providers for creating Connection Settings + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 BotConnectionListServiceProvidersViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-06-15-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.BotService$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.BotService'"); + } + + // 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.BotService/listAuthServiceProviders" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.BotConnectionListServiceProvidersWithResult_Call (request, eventListener,sender); + } + } + + /// Lists the available Service Providers for creating Connection Settings + /// Azure Subscription ID. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 BotConnectionListServiceProvidersWithResult(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-06-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.BotService/listAuthServiceProviders" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.BotConnectionListServiceProvidersWithResult_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.BotService.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 BotConnectionListServiceProvidersWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ServiceProviderResponseList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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.BotService.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). @@ -868,7 +1613,7 @@ public partial class BotService /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task BotConnectionListServiceProviders_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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task BotConnectionListServiceProviders_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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -879,6 +1624,7 @@ public partial class BotService await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -886,13 +1632,13 @@ public partial class BotService case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ServiceProviderResponseList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ServiceProviderResponseList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -925,10 +1671,10 @@ public partial class BotService } /// Get a Connection Setting registration for a Bot Service + /// Azure Subscription ID. /// The name of the Bot resource group in the user subscription. /// The name of the Bot resource. /// The name of the Bot Service Connection Setting resource. - /// Azure Subscription ID. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -937,7 +1683,7 @@ public partial class BotService /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task BotConnectionListWithSecrets(string resourceGroupName, string resourceName, string connectionName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BotConnectionListWithSecrets(string subscriptionId, string resourceGroupName, string resourceName, string connectionName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { var apiVersion = @"2022-06-15-preview"; // Constant Parameters @@ -967,7 +1713,7 @@ public partial class BotService await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BotConnectionListWithSecrets_Call(request,onOk,onDefault,eventListener,sender); + await this.BotConnectionListWithSecrets_Call (request, onOk,onDefault,eventListener,sender); } } @@ -981,7 +1727,7 @@ public partial class BotService /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task BotConnectionListWithSecretsViaIdentity(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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BotConnectionListWithSecretsViaIdentity(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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { var apiVersion = @"2022-06-15-preview"; // Constant Parameters @@ -992,14 +1738,14 @@ public partial class BotService var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.BotService/botServices/(?[^/]+)/connections/(?[^/]+)$", 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.BotService/botServices/{resourceName}/connections/{connectionName}/listWithSecrets'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/connections/{connectionName}'"); } // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var resourceName = _match.Groups["resourceName"].Value; var connectionName = _match.Groups["connectionName"].Value; - var subscriptionId = _match.Groups["subscriptionId"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -1024,11 +1770,173 @@ public partial class BotService await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BotConnectionListWithSecrets_Call(request,onOk,onDefault,eventListener,sender); + await this.BotConnectionListWithSecrets_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a Connection Setting registration for a Bot Service + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 BotConnectionListWithSecretsViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-06-15-preview"; + // 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.BotService/botServices/(?[^/]+)/connections/(?[^/]+)$", 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.BotService/botServices/{resourceName}/connections/{connectionName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var resourceName = _match.Groups["resourceName"].Value; + var connectionName = _match.Groups["connectionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.BotService/botServices/" + + resourceName + + "/connections/" + + connectionName + + "/listWithSecrets" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.BotConnectionListWithSecretsWithResult_Call (request, eventListener,sender); + } + } + + /// Get a Connection Setting registration for a Bot Service + /// Azure Subscription ID. + /// The name of the Bot resource group in the user subscription. + /// The name of the Bot resource. + /// The name of the Bot Service Connection Setting resource. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 BotConnectionListWithSecretsWithResult(string subscriptionId, string resourceGroupName, string resourceName, string connectionName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-06-15-preview"; + // 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.BotService/botServices/" + + global::System.Uri.EscapeDataString(resourceName) + + "/connections/" + + global::System.Uri.EscapeDataString(connectionName) + + "/listWithSecrets" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.BotConnectionListWithSecretsWithResult_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.BotService.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 BotConnectionListWithSecretsWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ConnectionSetting.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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.BotService.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 @@ -1038,7 +1946,7 @@ public partial class BotService /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task BotConnectionListWithSecrets_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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task BotConnectionListWithSecrets_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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -1049,6 +1957,7 @@ public partial class BotService await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -1056,13 +1965,13 @@ public partial class BotService case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ConnectionSetting.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ConnectionSetting.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -1081,39 +1990,39 @@ public partial class BotService /// Validation method for method. Call this like the actual call, but you will /// get validation events back. /// + /// Azure Subscription ID. /// The name of the Bot resource group in the user subscription. /// The name of the Bot resource. /// The name of the Bot Service Connection Setting resource. - /// Azure Subscription ID. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task BotConnectionListWithSecrets_Validate(string resourceGroupName, string resourceName, string connectionName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task BotConnectionListWithSecrets_Validate(string subscriptionId, string resourceGroupName, string resourceName, string connectionName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,2); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,64); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); await eventListener.AssertNotNull(nameof(resourceName),resourceName); await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,2); await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,64); - await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + await eventListener.AssertRegEx(nameof(resourceName), resourceName, @"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); await eventListener.AssertNotNull(nameof(connectionName),connectionName); await eventListener.AssertMinimumLength(nameof(connectionName),connectionName,2); await eventListener.AssertMaximumLength(nameof(connectionName),connectionName,64); - await eventListener.AssertRegEx(nameof(connectionName),connectionName,@"^[a-zA-Z0-9][\sa-zA-Z0-9_.-]*$"); - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(connectionName), connectionName, @"^[a-zA-Z0-9][\sa-zA-Z0-9_.-]*$"); } } - /// Updates a Connection Setting registration for a Bot Service + /// update a Connection Setting registration for a Bot Service + /// Azure Subscription ID. /// The name of the Bot resource group in the user subscription. /// The name of the Bot resource. /// The name of the Bot Service Connection Setting resource. - /// Azure Subscription ID. /// The parameters to provide for updating the Connection Setting. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns 201 (Created). @@ -1121,10 +2030,11 @@ public partial class BotService /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 BotConnectionUpdate(string resourceGroupName, string resourceName, string connectionName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSetting 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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BotConnectionUpdate(string subscriptionId, string resourceGroupName, string resourceName, string connectionName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSetting 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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-06-15-preview"; // Constant Parameters @@ -1153,15 +2063,15 @@ public partial class BotService await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BotConnectionUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + await this.BotConnectionUpdate_Call (request, onOk,onCreated,onDefault,eventListener,sender); } } - /// Updates a Connection Setting registration for a Bot Service + /// update a Connection Setting registration for a Bot Service /// /// The parameters to provide for updating the Connection Setting. /// a delegate that is called when the remote service returns 200 (OK). @@ -1170,10 +2080,11 @@ public partial class BotService /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 BotConnectionUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSetting 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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BotConnectionUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSetting 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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-06-15-preview"; // Constant Parameters @@ -1188,10 +2099,10 @@ public partial class BotService } // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var resourceName = _match.Groups["resourceName"].Value; var connectionName = _match.Groups["connectionName"].Value; - var subscriptionId = _match.Groups["subscriptionId"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -1215,120 +2126,139 @@ public partial class BotService await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BotConnectionUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + await this.BotConnectionUpdate_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 Connection Setting registration for a Bot Service + /// + /// The parameters to provide for updating the Connection Setting. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 BotConnectionUpdate_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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BotConnectionUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSetting body, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2022-06-15-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.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ConnectionSetting.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - case global::System.Net.HttpStatusCode.Created: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ConnectionSetting.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.BotService/botServices/(?[^/]+)/connections/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/connections/{connectionName}'"); } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var resourceName = _match.Groups["resourceName"].Value; + var connectionName = _match.Groups["connectionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.BotService/botServices/" + + resourceName + + "/connections/" + + connectionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.BotConnectionUpdateWithResult_Call (request, eventListener,sender); } } - /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. - /// + /// update a Connection Setting registration for a Bot Service + /// Azure Subscription ID. /// The name of the Bot resource group in the user subscription. /// The name of the Bot resource. /// The name of the Bot Service Connection Setting resource. - /// Azure Subscription ID. - /// The parameters to provide for updating the Connection Setting. + /// Json string supplied to the BotConnectionUpdate 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.BotService.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 BotConnectionUpdate_Validate(string resourceGroupName, string resourceName, string connectionName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSetting body, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener) + public async global::System.Threading.Tasks.Task BotConnectionUpdateViaJsonString(string subscriptionId, string resourceGroupName, string resourceName, string connectionName, 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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { + var apiVersion = @"2022-06-15-preview"; + // Constant Parameters using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,2); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,64); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); - await eventListener.AssertNotNull(nameof(resourceName),resourceName); - await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,2); - await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,64); - await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); - await eventListener.AssertNotNull(nameof(connectionName),connectionName); - await eventListener.AssertMinimumLength(nameof(connectionName),connectionName,2); - await eventListener.AssertMaximumLength(nameof(connectionName),connectionName,64); - await eventListener.AssertRegEx(nameof(connectionName),connectionName,@"^[a-zA-Z0-9][\sa-zA-Z0-9_.-]*$"); - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - 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.BotService/botServices/" + + global::System.Uri.EscapeDataString(resourceName) + + "/connections/" + + global::System.Uri.EscapeDataString(connectionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BotConnectionUpdate_Call (request, onOk,onCreated,onDefault,eventListener,sender); } } - /// Creates a Bot Service. Bot Service is a resource group wide resource type. + /// update a Connection Setting registration for a Bot Service + /// Azure Subscription ID. /// The name of the Bot resource group in the user subscription. /// The name of the Bot resource. - /// Azure Subscription ID. - /// The parameters to provide for the created bot. - /// 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). + /// The name of the Bot Service Connection Setting resource. + /// Json string supplied to the BotConnectionUpdate operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 BotsCreate(string resourceGroupName, string resourceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot 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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BotConnectionUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string resourceName, string connectionName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { var apiVersion = @"2022-06-15-preview"; // Constant Parameters @@ -1342,87 +2272,146 @@ public partial class BotService + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.BotService/botServices/" + global::System.Uri.EscapeDataString(resourceName) + + "/connections/" + + global::System.Uri.EscapeDataString(connectionName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.BotsCreate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + return await this.BotConnectionUpdateWithResult_Call (request, eventListener,sender); } } - /// Creates a Bot Service. Bot Service is a resource group wide resource type. - /// - /// The parameters to provide for the created bot. - /// 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 Connection Setting registration for a Bot Service + /// Azure Subscription ID. + /// The name of the Bot resource group in the user subscription. + /// The name of the Bot resource. + /// The name of the Bot Service Connection Setting resource. + /// The parameters to provide for updating the Connection Setting. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 BotsCreateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot 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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BotConnectionUpdateWithResult(string subscriptionId, string resourceGroupName, string resourceName, string connectionName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSetting body, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-06-15-preview"; // 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.BotService/botServices/(?[^/]+)$", 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.BotService/botServices/{resourceName}'"); - } - - // replace URI parameters with values from identity - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var resourceName = _match.Groups["resourceName"].Value; - var subscriptionId = _match.Groups["subscriptionId"].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.BotService/botServices/" - + resourceName + + global::System.Uri.EscapeDataString(resourceName) + + "/connections/" + + global::System.Uri.EscapeDataString(connectionName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.BotsCreate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + return await this.BotConnectionUpdateWithResult_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.BotService.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 BotConnectionUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ConnectionSetting.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ConnectionSetting.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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.BotService.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). @@ -1433,7 +2422,7 @@ public partial class BotService /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task BotsCreate_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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task BotConnectionUpdate_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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -1444,6 +2433,7 @@ public partial class BotService await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -1451,19 +2441,19 @@ public partial class BotService case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Bot.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ConnectionSetting.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } case global::System.Net.HttpStatusCode.Created: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Bot.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ConnectionSetting.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -1479,49 +2469,56 @@ public partial class BotService } /// - /// 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. /// + /// Azure Subscription ID. /// The name of the Bot resource group in the user subscription. /// The name of the Bot resource. - /// Azure Subscription ID. - /// The parameters to provide for the created bot. + /// The name of the Bot Service Connection Setting resource. + /// The parameters to provide for updating the Connection 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 BotsCreate_Validate(string resourceGroupName, string resourceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot body, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task BotConnectionUpdate_Validate(string subscriptionId, string resourceGroupName, string resourceName, string connectionName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSetting body, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,2); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,64); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); await eventListener.AssertNotNull(nameof(resourceName),resourceName); await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,2); await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,64); - await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(resourceName), resourceName, @"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + await eventListener.AssertNotNull(nameof(connectionName),connectionName); + await eventListener.AssertMinimumLength(nameof(connectionName),connectionName,2); + await eventListener.AssertMaximumLength(nameof(connectionName),connectionName,64); + await eventListener.AssertRegEx(nameof(connectionName), connectionName, @"^[a-zA-Z0-9][\sa-zA-Z0-9_.-]*$"); await eventListener.AssertNotNull(nameof(body), body); await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Deletes a Bot Service from the resource group. + /// create a Bot Service. Bot Service is a resource group wide resource type. + /// Azure Subscription ID. /// The name of the Bot resource group in the user subscription. /// The name of the Bot resource. - /// Azure Subscription ID. + /// The parameters to provide for the created bot. /// 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. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 BotsDelete(string resourceGroupName, string resourceName, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BotsCreate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot 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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-06-15-preview"; // Constant Parameters @@ -1543,27 +2540,33 @@ public partial class BotService // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BotsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.BotsCreate_Call (request, onOk,onCreated,onDefault,eventListener,sender); } } - /// Deletes a Bot Service from the resource group. + /// create a Bot Service. Bot Service is a resource group wide resource type. /// + /// The parameters to provide for the created bot. /// 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. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 BotsDeleteViaIdentity(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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BotsCreateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot 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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-06-15-preview"; // Constant Parameters @@ -1578,9 +2581,9 @@ public partial class BotService } // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var resourceName = _match.Groups["resourceName"].Value; - var subscriptionId = _match.Groups["subscriptionId"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -1597,103 +2600,83 @@ public partial class BotService // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BotsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.BotsCreate_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 204 (NoContent). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// create a Bot Service. Bot Service is a resource group wide resource type. + /// + /// The parameters to provide for the created bot. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 BotsDelete_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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BotsCreateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot body, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2022-06-15-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("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.BotService/botServices/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}'"); } - } - } - /// - /// Validation method for method. Call this like the actual call, but you will get validation events - /// back. - /// - /// The name of the Bot resource group in the user subscription. - /// The name of the Bot resource. - /// Azure Subscription ID. - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task BotsDelete_Validate(string resourceGroupName, string resourceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,2); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,64); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); - await eventListener.AssertNotNull(nameof(resourceName),resourceName); - await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,2); - await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,64); - await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var resourceName = _match.Groups["resourceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.BotService/botServices/" + + resourceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.BotsCreateWithResult_Call (request, eventListener,sender); } } - /// Returns a BotService specified by the parameters. + /// create a Bot Service. Bot Service is a resource group wide resource type. + /// Azure Subscription ID. /// The name of the Bot resource group in the user subscription. /// The name of the Bot resource. - /// Azure Subscription ID. + /// Json string supplied to the BotsCreate 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. @@ -1701,7 +2684,7 @@ public partial class BotService /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task BotsGet(string resourceGroupName, string resourceName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BotsCreateViaJsonString(string subscriptionId, string resourceGroupName, string resourceName, 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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { var apiVersion = @"2022-06-15-preview"; // Constant Parameters @@ -1723,26 +2706,31 @@ public partial class BotService // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BotsGet_Call(request,onOk,onDefault,eventListener,sender); + await this.BotsCreate_Call (request, onOk,onCreated,onDefault,eventListener,sender); } } - /// Check whether a bot name is available. - /// The request body parameters to provide for the check name availability 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). + /// create a Bot Service. Bot Service is a resource group wide resource type. + /// Azure Subscription ID. + /// The name of the Bot resource group in the user subscription. + /// The name of the Bot resource. + /// Json string supplied to the BotsCreate operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 BotsGetCheckNameAvailability(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICheckNameAvailabilityRequestBody body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BotsCreateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string resourceName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { var apiVersion = @"2022-06-15-preview"; // Constant Parameters @@ -1750,81 +2738,150 @@ public partial class BotService { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/providers/Microsoft.BotService/checkNameAvailability" + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.BotService/botServices/" + + global::System.Uri.EscapeDataString(resourceName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.BotsGetCheckNameAvailability_Call(request,onOk,onDefault,eventListener,sender); + return await this.BotsCreateWithResult_Call (request, eventListener,sender); } } - /// Check whether a bot name is available. - /// - /// The request body parameters to provide for the check name availability 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). + /// create a Bot Service. Bot Service is a resource group wide resource type. + /// Azure Subscription ID. + /// The name of the Bot resource group in the user subscription. + /// The name of the Bot resource. + /// The parameters to provide for the created bot. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 BotsGetCheckNameAvailabilityViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICheckNameAvailabilityRequestBody body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BotsCreateWithResult(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot body, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-06-15-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.BotService$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.BotService/checkNameAvailability'"); - } - - // replace URI parameters with values from identity // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/providers/Microsoft.BotService/checkNameAvailability" + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.BotService/botServices/" + + global::System.Uri.EscapeDataString(resourceName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.BotsGetCheckNameAvailability_Call(request,onOk,onDefault,eventListener,sender); + return await this.BotsCreateWithResult_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.BotService.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 BotsCreateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Bot.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Bot.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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.BotService.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). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -1832,7 +2889,7 @@ public partial class BotService /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task BotsGetCheckNameAvailability_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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task BotsCreate_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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -1843,6 +2900,7 @@ public partial class BotService await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -1850,13 +2908,19 @@ public partial class BotService case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.CheckNameAvailabilityResponseBody.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Bot.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Bot.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -1872,26 +2936,83 @@ public partial class BotService } /// - /// 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 request body parameters to provide for the check name availability request + /// Azure Subscription ID. + /// The name of the Bot resource group in the user subscription. + /// The name of the Bot resource. + /// The parameters to provide for the created bot. /// 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 BotsGetCheckNameAvailability_Validate(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICheckNameAvailabilityRequestBody body, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task BotsCreate_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot body, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,2); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,64); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + await eventListener.AssertNotNull(nameof(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,2); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,64); + await eventListener.AssertRegEx(nameof(resourceName), resourceName, @"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); await eventListener.AssertNotNull(nameof(body), body); await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Returns a BotService specified by the parameters. + /// Deletes a Bot Service from the resource group. + /// Azure Subscription ID. + /// The name of the Bot resource group in the user subscription. + /// The name of the Bot resource. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 BotsDelete(string subscriptionId, string resourceGroupName, string resourceName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-06-15-preview"; + // 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.BotService/botServices/" + + global::System.Uri.EscapeDataString(resourceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BotsDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes a Bot Service from the resource group. /// /// 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. @@ -1899,7 +3020,7 @@ public partial class BotService /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task BotsGetViaIdentity(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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BotsDeleteViaIdentity(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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { var apiVersion = @"2022-06-15-preview"; // Constant Parameters @@ -1914,9 +3035,9 @@ public partial class BotService } // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var resourceName = _match.Groups["resourceName"].Value; - var subscriptionId = _match.Groups["subscriptionId"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -1933,18 +3054,19 @@ public partial class BotService // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BotsGet_Call(request,onOk,onDefault,eventListener,sender); + await this.BotsDelete_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. @@ -1952,7 +3074,7 @@ public partial class BotService /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task BotsGet_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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task BotsDelete_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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -1963,6 +3085,7 @@ public partial class BotService await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -1970,13 +3093,19 @@ public partial class BotService case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Bot.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response); break; } - default: + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -1992,34 +3121,36 @@ public partial class BotService } /// - /// Validation method for method. Call this like the actual call, but you will get validation events + /// Validation method for method. Call this like the actual call, but you will get validation events /// back. /// + /// Azure Subscription ID. /// The name of the Bot resource group in the user subscription. /// The name of the Bot resource. - /// Azure Subscription ID. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task BotsGet_Validate(string resourceGroupName, string resourceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task BotsDelete_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,2); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,64); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); await eventListener.AssertNotNull(nameof(resourceName),resourceName); await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,2); await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,64); - await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(resourceName), resourceName, @"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); } } - /// Returns all the resources of a particular type belonging to a subscription. + /// Returns a BotService specified by the parameters. /// Azure Subscription ID. + /// The name of the Bot resource group in the user subscription. + /// The name of the Bot 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). @@ -2028,7 +3159,7 @@ public partial class BotService /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task BotsList(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BotsGet(string subscriptionId, string resourceGroupName, string resourceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { var apiVersion = @"2022-06-15-preview"; // Constant Parameters @@ -2038,7 +3169,10 @@ public partial class BotService var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + global::System.Uri.EscapeDataString(subscriptionId) - + "/providers/Microsoft.BotService/botServices" + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.BotService/botServices/" + + global::System.Uri.EscapeDataString(resourceName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -2052,22 +3186,22 @@ public partial class BotService await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BotsList_Call(request,onOk,onDefault,eventListener,sender); + await this.BotsGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Returns all the resources of a particular type belonging to a resource group - /// The name of the Bot resource group in the user subscription. - /// Azure Subscription ID. + /// Check whether a bot name is available. + /// The request body parameters to provide for the check name availability 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.BotService.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 BotsListByResourceGroup(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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BotsGetCheckNameAvailability(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityRequestBody body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-06-15-preview"; // Constant Parameters @@ -2075,11 +3209,7 @@ public partial class BotService { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + global::System.Uri.EscapeDataString(subscriptionId) - + "/resourceGroups/" - + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.BotService/botServices" + "/providers/Microsoft.BotService/checkNameAvailability" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -2088,26 +3218,32 @@ public partial class BotService // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BotsListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + await this.BotsGetCheckNameAvailability_Call (request, onOk,onDefault,eventListener,sender); } } - /// Returns all the resources of a particular type belonging to a resource group + /// Check whether a bot name is available. /// + /// The request body parameters to provide for the check name availability 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.BotService.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 BotsListByResourceGroupViaIdentity(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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BotsGetCheckNameAvailabilityViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityRequestBody body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-06-15-preview"; // Constant Parameters @@ -2115,22 +3251,16 @@ public partial class BotService { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.BotService/botServices$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.BotService$", 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.BotService/botServices'"); + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.BotService'"); } // replace URI parameters with values from identity - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var subscriptionId = _match.Groups["subscriptionId"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.BotService/botServices" + "/providers/Microsoft.BotService/checkNameAvailability" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -2139,135 +3269,248 @@ public partial class BotService // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BotsListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + await this.BotsGetCheckNameAvailability_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). + /// Check whether a bot name is available. + /// + /// The request body parameters to provide for the check name availability request /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 BotsListByResourceGroup_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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BotsGetCheckNameAvailabilityViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityRequestBody body, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2022-06-15-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.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.BotResponseList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.BotService$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.BotService'"); } + + // replace URI parameters with values from identity + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.BotService/checkNameAvailability" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.BotsGetCheckNameAvailabilityWithResult_Call (request, eventListener,sender); } } - /// - /// Validation method for method. Call this like the actual call, but you will get - /// validation events back. - /// - /// The name of the Bot resource group in the user subscription. - /// Azure Subscription ID. + /// Check whether a bot name is available. + /// Json string supplied to the BotsGetCheckNameAvailability 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.BotService.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 BotsListByResourceGroup_Validate(string resourceGroupName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener) + public async global::System.Threading.Tasks.Task BotsGetCheckNameAvailabilityViaJsonString(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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { + var apiVersion = @"2022-06-15-preview"; + // Constant Parameters using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,2); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,64); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.BotService/checkNameAvailability" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BotsGetCheckNameAvailability_Call (request, onOk,onDefault,eventListener,sender); } } - /// Returns all the resources of a particular type belonging to 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). + /// Check whether a bot name is available. + /// Json string supplied to the BotsGetCheckNameAvailability operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 BotsListViaIdentity(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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BotsGetCheckNameAvailabilityViaJsonStringWithResult(global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { var apiVersion = @"2022-06-15-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( + "/providers/Microsoft.BotService/checkNameAvailability" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.BotService/botServices$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.BotService/botServices'"); - } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].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.BotService.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.BotsGetCheckNameAvailabilityWithResult_Call (request, eventListener,sender); + } + } + + /// Check whether a bot name is available. + /// The request body parameters to provide for the check name availability request + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 BotsGetCheckNameAvailabilityWithResult(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityRequestBody body, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2022-06-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/providers/Microsoft.BotService/botServices" + "/providers/Microsoft.BotService/checkNameAvailability" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.BotsList_Call(request,onOk,onDefault,eventListener,sender); + return await this.BotsGetCheckNameAvailabilityWithResult_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.BotService.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 BotsGetCheckNameAvailabilityWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.CheckNameAvailabilityResponseBody.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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.BotService.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 @@ -2277,7 +3520,7 @@ public partial class BotService /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task BotsList_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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task BotsGetCheckNameAvailability_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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -2288,6 +3531,7 @@ public partial class BotService await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -2295,13 +3539,13 @@ public partial class BotService case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.BotResponseList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.CheckNameAvailabilityResponseBody.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -2317,29 +3561,26 @@ public partial class BotService } /// - /// 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. /// - /// Azure Subscription ID. + /// The request body parameters to provide for the check name availability 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 BotsList_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task BotsGetCheckNameAvailability_Validate(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityRequestBody body, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Updates a Bot Service - /// The name of the Bot resource group in the user subscription. - /// The name of the Bot resource. - /// Azure Subscription ID. - /// The parameters to provide for the created bot. + /// Returns a BotService specified by the parameters. + /// /// 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. @@ -2347,20 +3588,32 @@ public partial class BotService /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task BotsUpdate(string resourceGroupName, string resourceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot 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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BotsGetViaIdentity(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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { var apiVersion = @"2022-06-15-preview"; // 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.BotService/botServices/(?[^/]+)$", 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.BotService/botServices/{resourceName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var resourceName = _match.Groups["resourceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + global::System.Uri.EscapeDataString(subscriptionId) + + subscriptionId + "/resourceGroups/" - + global::System.Uri.EscapeDataString(resourceGroupName) + + resourceGroupName + "/providers/Microsoft.BotService/botServices/" - + global::System.Uri.EscapeDataString(resourceName) + + resourceName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -2369,32 +3622,24 @@ public partial class BotService // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BotsUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + await this.BotsGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Updates a Bot Service + /// Returns a BotService specified by the parameters. /// - /// The parameters to provide for the created bot. - /// 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.BotService.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 BotsUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot 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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BotsGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { var apiVersion = @"2022-06-15-preview"; // Constant Parameters @@ -2409,9 +3654,9 @@ public partial class BotService } // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var resourceName = _match.Groups["resourceName"].Value; - var subscriptionId = _match.Groups["subscriptionId"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -2424,125 +3669,30 @@ public partial class BotService + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.BotsUpdate_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). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 BotsUpdate_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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Bot.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - case global::System.Net.HttpStatusCode.Created: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Bot.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); - } + return await this.BotsGetWithResult_Call (request, eventListener,sender); } } - /// - /// Validation method for method. Call this like the actual call, but you will get validation events - /// back. - /// - /// The name of the Bot resource group in the user subscription. - /// The name of the Bot resource. + /// Returns a BotService specified by the parameters. /// Azure Subscription ID. - /// The parameters to provide for the created bot. - /// 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 BotsUpdate_Validate(string resourceGroupName, string resourceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot body, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,2); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,64); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); - await eventListener.AssertNotNull(nameof(resourceName),resourceName); - await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,2); - await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,64); - await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); - } - } - - /// Creates a Channel registration for a Bot Service /// The name of the Bot resource group in the user subscription. /// The name of the Bot resource. - /// The name of the Channel resource. - /// Azure Subscription ID. - /// The parameters to provide for the created bot. - /// 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.BotService.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 ChannelsCreate(string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.ChannelName channelName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannel 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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BotsGetWithResult(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { var apiVersion = @"2022-06-15-preview"; // Constant Parameters @@ -2556,95 +3706,86 @@ public partial class BotService + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.BotService/botServices/" + global::System.Uri.EscapeDataString(resourceName) - + "/channels/" - + global::System.Uri.EscapeDataString(channelName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ChannelsCreate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + return await this.BotsGetWithResult_Call (request, eventListener,sender); } } - /// Creates a Channel registration for a Bot Service - /// - /// The parameters to provide for the created bot. - /// 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). + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 ChannelsCreateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannel 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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task BotsGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { - var apiVersion = @"2022-06-15-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.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.BotService/botServices/(?[^/]+)/channels/(?[^/]+)$", 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.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Bot.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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 '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/channels/{channelName}'"); + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); } - - // replace URI parameters with values from identity - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var resourceName = _match.Groups["resourceName"].Value; - var channelName = _match.Groups["channelName"].Value; - var subscriptionId = _match.Groups["subscriptionId"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.BotService/botServices/" - + resourceName - + "/channels/" - + channelName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.ChannelsCreate_Call(request,onOk,onCreated,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 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. @@ -2652,7 +3793,7 @@ public partial class BotService /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ChannelsCreate_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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task BotsGet_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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -2663,6 +3804,7 @@ public partial class BotService await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -2670,19 +3812,13 @@ public partial class BotService case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.BotChannel.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - case global::System.Net.HttpStatusCode.Created: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.BotChannel.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Bot.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -2698,45 +3834,35 @@ public partial class BotService } /// - /// 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. /// + /// Azure Subscription ID. /// The name of the Bot resource group in the user subscription. /// The name of the Bot resource. - /// The name of the Channel resource. - /// Azure Subscription ID. - /// The parameters to provide for the created bot. /// 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 ChannelsCreate_Validate(string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.ChannelName channelName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannel body, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task BotsGet_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,2); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,64); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); await eventListener.AssertNotNull(nameof(resourceName),resourceName); await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,2); await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,64); - await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); - await eventListener.AssertNotNull(nameof(channelName),channelName); - await eventListener.AssertEnum(nameof(channelName),channelName,@"AlexaChannel", @"FacebookChannel", @"EmailChannel", @"KikChannel", @"TelegramChannel", @"SlackChannel", @"MsTeamsChannel", @"SkypeChannel", @"WebChatChannel", @"DirectLineChannel", @"SmsChannel", @"LineChannel", @"DirectLineSpeechChannel", @"OutlookChannel", @"Omnichannel", @"TelephonyChannel"); - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); + await eventListener.AssertRegEx(nameof(resourceName), resourceName, @"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); } } - /// Deletes a Channel registration from a Bot Service - /// The name of the Bot resource group in the user subscription. - /// The name of the Bot resource. - /// The name of the Bot resource. + /// Returns all the resources of a particular type belonging to a subscription. /// Azure Subscription ID. /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 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. @@ -2744,7 +3870,7 @@ public partial class BotService /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ChannelsDelete(string resourceGroupName, string resourceName, string channelName, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BotsList(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { var apiVersion = @"2022-06-15-preview"; // Constant Parameters @@ -2754,12 +3880,7 @@ public partial class BotService var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + global::System.Uri.EscapeDataString(subscriptionId) - + "/resourceGroups/" - + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.BotService/botServices/" - + global::System.Uri.EscapeDataString(resourceName) - + "/channels/" - + global::System.Uri.EscapeDataString(channelName) + + "/providers/Microsoft.BotService/botServices" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -2768,19 +3889,19 @@ public partial class BotService // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ChannelsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.BotsList_Call (request, onOk,onDefault,eventListener,sender); } } - /// Deletes a Channel registration from a Bot Service - /// + /// Returns all the resources of a particular type belonging to a resource group + /// Azure Subscription ID. + /// The name of the Bot resource group in the user 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 /// elsewhere). /// an instance that will receive events. @@ -2788,25 +3909,2862 @@ public partial class BotService /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ChannelsDeleteViaIdentity(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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BotsListByResourceGroup(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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { var apiVersion = @"2022-06-15-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( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.BotService/botServices" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.BotService/botServices/(?[^/]+)/channels/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BotsListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Returns all the resources of a particular type belonging to 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.BotService.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 BotsListByResourceGroupViaIdentity(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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-06-15-preview"; + // 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.BotService/botServices$", 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.BotService/botServices'"); + } + + // 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.BotService/botServices" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BotsListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Returns all the resources of a particular type belonging to a resource group + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 BotsListByResourceGroupViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-06-15-preview"; + // 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.BotService/botServices$", 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.BotService/botServices'"); + } + + // 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.BotService/botServices" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.BotsListByResourceGroupWithResult_Call (request, eventListener,sender); + } + } + + /// Returns all the resources of a particular type belonging to a resource group + /// Azure Subscription ID. + /// The name of the Bot resource group in the user subscription. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 BotsListByResourceGroupWithResult(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-06-15-preview"; + // 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.BotService/botServices" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.BotsListByResourceGroupWithResult_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.BotService.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 BotsListByResourceGroupWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.BotResponseList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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.BotService.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.BotService.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 BotsListByResourceGroup_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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.BotResponseList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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. + /// + /// Azure Subscription ID. + /// The name of the Bot resource group in the user 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 BotsListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,2); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,64); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + } + } + + /// Returns all the resources of a particular type belonging to 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.BotService.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 BotsListViaIdentity(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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-06-15-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.BotService/botServices$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.BotService/botServices'"); + } + + // 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.BotService/botServices" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BotsList_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Returns all the resources of a particular type belonging to a subscription. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 BotsListViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-06-15-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.BotService/botServices$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.BotService/botServices'"); + } + + // 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.BotService/botServices" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.BotsListWithResult_Call (request, eventListener,sender); + } + } + + /// Returns all the resources of a particular type belonging to a subscription. + /// Azure Subscription ID. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 BotsListWithResult(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-06-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.BotService/botServices" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.BotsListWithResult_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.BotService.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 BotsListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.BotResponseList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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.BotService.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.BotService.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 BotsList_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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.BotResponseList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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. + /// + /// Azure Subscription ID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BotsList_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + } + } + + /// update a Bot Service + /// Azure Subscription ID. + /// The name of the Bot resource group in the user subscription. + /// The name of the Bot resource. + /// The parameters to provide for the created bot. + /// 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.BotService.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 BotsUpdate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot 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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2022-06-15-preview"; + // 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.BotService/botServices/" + + global::System.Uri.EscapeDataString(resourceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BotsUpdate_Call (request, onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// update a Bot Service + /// + /// The parameters to provide for the created bot. + /// 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.BotService.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 BotsUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot 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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2022-06-15-preview"; + // 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.BotService/botServices/(?[^/]+)$", 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.BotService/botServices/{resourceName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var resourceName = _match.Groups["resourceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.BotService/botServices/" + + resourceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BotsUpdate_Call (request, onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// update a Bot Service + /// + /// The parameters to provide for the created bot. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 BotsUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot body, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2022-06-15-preview"; + // 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.BotService/botServices/(?[^/]+)$", 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.BotService/botServices/{resourceName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var resourceName = _match.Groups["resourceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.BotService/botServices/" + + resourceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.BotsUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// update a Bot Service + /// Azure Subscription ID. + /// The name of the Bot resource group in the user subscription. + /// The name of the Bot resource. + /// Json string supplied to the BotsUpdate 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.BotService.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 BotsUpdateViaJsonString(string subscriptionId, string resourceGroupName, string resourceName, 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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-06-15-preview"; + // 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.BotService/botServices/" + + global::System.Uri.EscapeDataString(resourceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BotsUpdate_Call (request, onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// update a Bot Service + /// Azure Subscription ID. + /// The name of the Bot resource group in the user subscription. + /// The name of the Bot resource. + /// Json string supplied to the BotsUpdate operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 BotsUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string resourceName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-06-15-preview"; + // 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.BotService/botServices/" + + global::System.Uri.EscapeDataString(resourceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.BotsUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// update a Bot Service + /// Azure Subscription ID. + /// The name of the Bot resource group in the user subscription. + /// The name of the Bot resource. + /// The parameters to provide for the created bot. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 BotsUpdateWithResult(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot body, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2022-06-15-preview"; + // 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.BotService/botServices/" + + global::System.Uri.EscapeDataString(resourceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.BotsUpdateWithResult_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.BotService.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 BotsUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Bot.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Bot.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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.BotService.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// 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.BotService.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 BotsUpdate_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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Bot.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Bot.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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. + /// + /// Azure Subscription ID. + /// The name of the Bot resource group in the user subscription. + /// The name of the Bot resource. + /// The parameters to provide for the created bot. + /// 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 BotsUpdate_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot body, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,2); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,64); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + await eventListener.AssertNotNull(nameof(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,2); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,64); + await eventListener.AssertRegEx(nameof(resourceName), resourceName, @"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// create a Channel registration for a Bot Service + /// Azure Subscription ID. + /// The name of the Bot resource group in the user subscription. + /// The name of the Bot resource. + /// The name of the Channel resource. + /// The parameters to provide for the created bot. + /// 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.BotService.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 ChannelsCreate(string subscriptionId, string resourceGroupName, string resourceName, string channelName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannel 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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2022-06-15-preview"; + // 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.BotService/botServices/" + + global::System.Uri.EscapeDataString(resourceName) + + "/channels/" + + global::System.Uri.EscapeDataString(channelName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ChannelsCreate_Call (request, onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// create a Channel registration for a Bot Service + /// + /// The parameters to provide for the created bot. + /// 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.BotService.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 ChannelsCreateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannel 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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2022-06-15-preview"; + // 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.BotService/botServices/(?[^/]+)/channels/(?[^/]+)$", 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.BotService/botServices/{resourceName}/channels/{channelName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var resourceName = _match.Groups["resourceName"].Value; + var channelName = _match.Groups["channelName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.BotService/botServices/" + + resourceName + + "/channels/" + + channelName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ChannelsCreate_Call (request, onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// create a Channel registration for a Bot Service + /// + /// The parameters to provide for the created bot. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 ChannelsCreateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannel body, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2022-06-15-preview"; + // 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.BotService/botServices/(?[^/]+)/channels/(?[^/]+)$", 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.BotService/botServices/{resourceName}/channels/{channelName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var resourceName = _match.Groups["resourceName"].Value; + var channelName = _match.Groups["channelName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.BotService/botServices/" + + resourceName + + "/channels/" + + channelName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ChannelsCreateWithResult_Call (request, eventListener,sender); + } + } + + /// create a Channel registration for a Bot Service + /// Azure Subscription ID. + /// The name of the Bot resource group in the user subscription. + /// The name of the Bot resource. + /// The name of the Channel resource. + /// Json string supplied to the ChannelsCreate 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.BotService.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 ChannelsCreateViaJsonString(string subscriptionId, string resourceGroupName, string resourceName, string channelName, 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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-06-15-preview"; + // 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.BotService/botServices/" + + global::System.Uri.EscapeDataString(resourceName) + + "/channels/" + + global::System.Uri.EscapeDataString(channelName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ChannelsCreate_Call (request, onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// create a Channel registration for a Bot Service + /// Azure Subscription ID. + /// The name of the Bot resource group in the user subscription. + /// The name of the Bot resource. + /// The name of the Channel resource. + /// Json string supplied to the ChannelsCreate operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 ChannelsCreateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string resourceName, string channelName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-06-15-preview"; + // 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.BotService/botServices/" + + global::System.Uri.EscapeDataString(resourceName) + + "/channels/" + + global::System.Uri.EscapeDataString(channelName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ChannelsCreateWithResult_Call (request, eventListener,sender); + } + } + + /// create a Channel registration for a Bot Service + /// Azure Subscription ID. + /// The name of the Bot resource group in the user subscription. + /// The name of the Bot resource. + /// The name of the Channel resource. + /// The parameters to provide for the created bot. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 ChannelsCreateWithResult(string subscriptionId, string resourceGroupName, string resourceName, string channelName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannel body, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2022-06-15-preview"; + // 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.BotService/botServices/" + + global::System.Uri.EscapeDataString(resourceName) + + "/channels/" + + global::System.Uri.EscapeDataString(channelName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ChannelsCreateWithResult_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.BotService.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 ChannelsCreateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.BotChannel.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.BotChannel.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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.BotService.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// 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.BotService.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 ChannelsCreate_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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.BotChannel.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.BotChannel.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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. + /// + /// Azure Subscription ID. + /// The name of the Bot resource group in the user subscription. + /// The name of the Bot resource. + /// The name of the Channel resource. + /// The parameters to provide for the created bot. + /// 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 ChannelsCreate_Validate(string subscriptionId, string resourceGroupName, string resourceName, string channelName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannel body, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,2); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,64); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + await eventListener.AssertNotNull(nameof(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,2); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,64); + await eventListener.AssertRegEx(nameof(resourceName), resourceName, @"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + await eventListener.AssertNotNull(nameof(channelName),channelName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes a Channel registration from a Bot Service + /// Azure Subscription ID. + /// The name of the Bot resource group in the user subscription. + /// The name of the Bot resource. + /// The name of the Bot resource. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 ChannelsDelete(string subscriptionId, string resourceGroupName, string resourceName, string channelName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-06-15-preview"; + // 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.BotService/botServices/" + + global::System.Uri.EscapeDataString(resourceName) + + "/channels/" + + global::System.Uri.EscapeDataString(channelName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ChannelsDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes a Channel registration from a Bot Service + /// + /// 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.BotService.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 ChannelsDeleteViaIdentity(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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-06-15-preview"; + // 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.BotService/botServices/(?[^/]+)/channels/(?[^/]+)$", 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.BotService/botServices/{resourceName}/channels/{channelName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var resourceName = _match.Groups["resourceName"].Value; + var channelName = _match.Groups["channelName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.BotService/botServices/" + + resourceName + + "/channels/" + + channelName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ChannelsDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 ChannelsDelete_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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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. + /// + /// Azure Subscription ID. + /// The name of the Bot resource group in the user subscription. + /// The name of the Bot resource. + /// The name of the Bot 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 ChannelsDelete_Validate(string subscriptionId, string resourceGroupName, string resourceName, string channelName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,2); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,64); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + await eventListener.AssertNotNull(nameof(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,2); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,64); + await eventListener.AssertRegEx(nameof(resourceName), resourceName, @"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + await eventListener.AssertNotNull(nameof(channelName),channelName); + await eventListener.AssertMinimumLength(nameof(channelName),channelName,2); + await eventListener.AssertMaximumLength(nameof(channelName),channelName,64); + await eventListener.AssertRegEx(nameof(channelName), channelName, @"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + } + } + + /// Returns a BotService Channel registration specified by the parameters. + /// Azure Subscription ID. + /// The name of the Bot resource group in the user subscription. + /// The name of the Bot resource. + /// The name of the Bot 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.BotService.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 ChannelsGet(string subscriptionId, string resourceGroupName, string resourceName, string channelName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-06-15-preview"; + // 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.BotService/botServices/" + + global::System.Uri.EscapeDataString(resourceName) + + "/channels/" + + global::System.Uri.EscapeDataString(channelName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ChannelsGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Returns a BotService Channel registration specified by the parameters. + /// + /// a delegate that is 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.BotService.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 ChannelsGetViaIdentity(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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-06-15-preview"; + // 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.BotService/botServices/(?[^/]+)/channels/(?[^/]+)$", 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.BotService/botServices/{resourceName}/channels/{channelName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var resourceName = _match.Groups["resourceName"].Value; + var channelName = _match.Groups["channelName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.BotService/botServices/" + + resourceName + + "/channels/" + + channelName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ChannelsGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Returns a BotService Channel registration specified by the parameters. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 ChannelsGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-06-15-preview"; + // 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.BotService/botServices/(?[^/]+)/channels/(?[^/]+)$", 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.BotService/botServices/{resourceName}/channels/{channelName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var resourceName = _match.Groups["resourceName"].Value; + var channelName = _match.Groups["channelName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.BotService/botServices/" + + resourceName + + "/channels/" + + channelName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ChannelsGetWithResult_Call (request, eventListener,sender); + } + } + + /// Returns a BotService Channel registration specified by the parameters. + /// Azure Subscription ID. + /// The name of the Bot resource group in the user subscription. + /// The name of the Bot resource. + /// The name of the Bot resource. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 ChannelsGetWithResult(string subscriptionId, string resourceGroupName, string resourceName, string channelName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-06-15-preview"; + // 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.BotService/botServices/" + + global::System.Uri.EscapeDataString(resourceName) + + "/channels/" + + global::System.Uri.EscapeDataString(channelName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ChannelsGetWithResult_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.BotService.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 ChannelsGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.BotChannel.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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.BotService.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.BotService.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 ChannelsGet_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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.BotChannel.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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. + /// + /// Azure Subscription ID. + /// The name of the Bot resource group in the user subscription. + /// The name of the Bot resource. + /// The name of the Bot 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 ChannelsGet_Validate(string subscriptionId, string resourceGroupName, string resourceName, string channelName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,2); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,64); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + await eventListener.AssertNotNull(nameof(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,2); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,64); + await eventListener.AssertRegEx(nameof(resourceName), resourceName, @"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + await eventListener.AssertNotNull(nameof(channelName),channelName); + await eventListener.AssertMinimumLength(nameof(channelName),channelName,2); + await eventListener.AssertMaximumLength(nameof(channelName),channelName,64); + await eventListener.AssertRegEx(nameof(channelName), channelName, @"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + } + } + + /// Returns all the Channel registrations of a particular BotService resource + /// Azure Subscription ID. + /// The name of the Bot resource group in the user subscription. + /// The name of the Bot 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.BotService.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 ChannelsListByResourceGroup(string subscriptionId, string resourceGroupName, string resourceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-06-15-preview"; + // 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.BotService/botServices/" + + global::System.Uri.EscapeDataString(resourceName) + + "/channels" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ChannelsListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Returns all the Channel registrations of a particular BotService 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.BotService.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 ChannelsListByResourceGroupViaIdentity(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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-06-15-preview"; + // 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.BotService/botServices/(?[^/]+)/channels$", 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.BotService/botServices/{resourceName}/channels'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var resourceName = _match.Groups["resourceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.BotService/botServices/" + + resourceName + + "/channels" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ChannelsListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Returns all the Channel registrations of a particular BotService resource + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 ChannelsListByResourceGroupViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-06-15-preview"; + // 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.BotService/botServices/(?[^/]+)/channels$", 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.BotService/botServices/{resourceName}/channels'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var resourceName = _match.Groups["resourceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.BotService/botServices/" + + resourceName + + "/channels" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ChannelsListByResourceGroupWithResult_Call (request, eventListener,sender); + } + } + + /// Returns all the Channel registrations of a particular BotService resource + /// Azure Subscription ID. + /// The name of the Bot resource group in the user subscription. + /// The name of the Bot resource. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 ChannelsListByResourceGroupWithResult(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-06-15-preview"; + // 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.BotService/botServices/" + + global::System.Uri.EscapeDataString(resourceName) + + "/channels" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ChannelsListByResourceGroupWithResult_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.BotService.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 ChannelsListByResourceGroupWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ChannelResponseList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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.BotService.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.BotService.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 ChannelsListByResourceGroup_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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ChannelResponseList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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. + /// + /// Azure Subscription ID. + /// The name of the Bot resource group in the user subscription. + /// The name of the Bot 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 ChannelsListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,2); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,64); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + await eventListener.AssertNotNull(nameof(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,2); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,64); + await eventListener.AssertRegEx(nameof(resourceName), resourceName, @"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + } + } + + /// Lists a Channel registration for a Bot Service including secrets + /// Azure Subscription ID. + /// The name of the Bot resource group in the user subscription. + /// The name of the Bot resource. + /// The name of the Channel 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.BotService.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 ChannelsListWithKeys(string subscriptionId, string resourceGroupName, string resourceName, string channelName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-06-15-preview"; + // 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.BotService/botServices/" + + global::System.Uri.EscapeDataString(resourceName) + + "/channels/" + + global::System.Uri.EscapeDataString(channelName) + + "/listChannelWithKeys" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ChannelsListWithKeys_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Lists a Channel registration for a Bot Service including secrets + /// + /// a delegate that is 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.BotService.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 ChannelsListWithKeysViaIdentity(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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-06-15-preview"; + // 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.BotService/botServices/(?[^/]+)/channels/(?[^/]+)$", 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.BotService/botServices/{resourceName}/channels/{channelName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var resourceName = _match.Groups["resourceName"].Value; + var channelName = _match.Groups["channelName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.BotService/botServices/" + + resourceName + + "/channels/" + + channelName + + "/listChannelWithKeys" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ChannelsListWithKeys_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Lists a Channel registration for a Bot Service including secrets + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 ChannelsListWithKeysViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-06-15-preview"; + // 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.BotService/botServices/(?[^/]+)/channels/(?[^/]+)$", 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.BotService/botServices/{resourceName}/channels/{channelName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var resourceName = _match.Groups["resourceName"].Value; + var channelName = _match.Groups["channelName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.BotService/botServices/" + + resourceName + + "/channels/" + + channelName + + "/listChannelWithKeys" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ChannelsListWithKeysWithResult_Call (request, eventListener,sender); + } + } + + /// Lists a Channel registration for a Bot Service including secrets + /// Azure Subscription ID. + /// The name of the Bot resource group in the user subscription. + /// The name of the Bot resource. + /// The name of the Channel resource. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 ChannelsListWithKeysWithResult(string subscriptionId, string resourceGroupName, string resourceName, string channelName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-06-15-preview"; + // 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.BotService/botServices/" + + global::System.Uri.EscapeDataString(resourceName) + + "/channels/" + + global::System.Uri.EscapeDataString(channelName) + + "/listChannelWithKeys" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ChannelsListWithKeysWithResult_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.BotService.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 ChannelsListWithKeysWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ListChannelWithKeysResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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.BotService.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.BotService.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 ChannelsListWithKeys_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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ListChannelWithKeysResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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. + /// + /// Azure Subscription ID. + /// The name of the Bot resource group in the user subscription. + /// The name of the Bot resource. + /// The name of the Channel 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 ChannelsListWithKeys_Validate(string subscriptionId, string resourceGroupName, string resourceName, string channelName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,2); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,64); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + await eventListener.AssertNotNull(nameof(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,2); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,64); + await eventListener.AssertRegEx(nameof(resourceName), resourceName, @"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + await eventListener.AssertNotNull(nameof(channelName),channelName); + } + } + + /// update a Channel registration for a Bot Service + /// Azure Subscription ID. + /// The name of the Bot resource group in the user subscription. + /// The name of the Bot resource. + /// The name of the Channel resource. + /// The parameters to provide for the created bot. + /// 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.BotService.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 ChannelsUpdate(string subscriptionId, string resourceGroupName, string resourceName, string channelName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannel 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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2022-06-15-preview"; + // 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.BotService/botServices/" + + global::System.Uri.EscapeDataString(resourceName) + + "/channels/" + + global::System.Uri.EscapeDataString(channelName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ChannelsUpdate_Call (request, onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// update a Channel registration for a Bot Service + /// + /// The parameters to provide for the created bot. + /// 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.BotService.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 ChannelsUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannel 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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2022-06-15-preview"; + // 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.BotService/botServices/(?[^/]+)/channels/(?[^/]+)$", 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.BotService/botServices/{resourceName}/channels/{channelName}'"); } // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var resourceName = _match.Groups["resourceName"].Value; var channelName = _match.Groups["channelName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.BotService/botServices/" + + resourceName + + "/channels/" + + channelName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ChannelsUpdate_Call (request, onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// update a Channel registration for a Bot Service + /// + /// The parameters to provide for the created bot. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 ChannelsUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannel body, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2022-06-15-preview"; + // 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.BotService/botServices/(?[^/]+)/channels/(?[^/]+)$", 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.BotService/botServices/{resourceName}/channels/{channelName}'"); + } + + // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var resourceName = _match.Groups["resourceName"].Value; + var channelName = _match.Groups["channelName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -2821,23 +6779,244 @@ public partial class BotService + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ChannelsUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// update a Channel registration for a Bot Service + /// Azure Subscription ID. + /// The name of the Bot resource group in the user subscription. + /// The name of the Bot resource. + /// The name of the Channel resource. + /// Json string supplied to the ChannelsUpdate 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.BotService.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 ChannelsUpdateViaJsonString(string subscriptionId, string resourceGroupName, string resourceName, string channelName, 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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-06-15-preview"; + // 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.BotService/botServices/" + + global::System.Uri.EscapeDataString(resourceName) + + "/channels/" + + global::System.Uri.EscapeDataString(channelName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ChannelsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.ChannelsUpdate_Call (request, onOk,onCreated,onDefault,eventListener,sender); } } - /// Actual wire call for method. + /// update a Channel registration for a Bot Service + /// Azure Subscription ID. + /// The name of the Bot resource group in the user subscription. + /// The name of the Bot resource. + /// The name of the Channel resource. + /// Json string supplied to the ChannelsUpdate operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 ChannelsUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string resourceName, string channelName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-06-15-preview"; + // 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.BotService/botServices/" + + global::System.Uri.EscapeDataString(resourceName) + + "/channels/" + + global::System.Uri.EscapeDataString(channelName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ChannelsUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// update a Channel registration for a Bot Service + /// Azure Subscription ID. + /// The name of the Bot resource group in the user subscription. + /// The name of the Bot resource. + /// The name of the Channel resource. + /// The parameters to provide for the created bot. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 ChannelsUpdateWithResult(string subscriptionId, string resourceGroupName, string resourceName, string channelName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannel body, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2022-06-15-preview"; + // 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.BotService/botServices/" + + global::System.Uri.EscapeDataString(resourceName) + + "/channels/" + + global::System.Uri.EscapeDataString(channelName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ChannelsUpdateWithResult_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.BotService.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 ChannelsUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.BotChannel.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.BotChannel.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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.BotService.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns 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. @@ -2845,7 +7024,7 @@ public partial class BotService /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ChannelsDelete_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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ChannelsUpdate_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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -2856,6 +7035,7 @@ public partial class BotService await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -2863,19 +7043,19 @@ public partial class BotService case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.BotChannel.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.BotChannel.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -2891,51 +7071,55 @@ public partial class BotService } /// - /// Validation method for method. Call this like the actual call, but you will get validation + /// Validation method for method. Call this like the actual call, but you will get validation /// events back. /// + /// Azure Subscription ID. /// The name of the Bot resource group in the user subscription. /// The name of the Bot resource. - /// The name of the Bot resource. - /// Azure Subscription ID. + /// The name of the Channel resource. + /// The parameters to provide for the created bot. /// 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 ChannelsDelete_Validate(string resourceGroupName, string resourceName, string channelName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ChannelsUpdate_Validate(string subscriptionId, string resourceGroupName, string resourceName, string channelName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannel body, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,2); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,64); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); await eventListener.AssertNotNull(nameof(resourceName),resourceName); await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,2); await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,64); - await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + await eventListener.AssertRegEx(nameof(resourceName), resourceName, @"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); await eventListener.AssertNotNull(nameof(channelName),channelName); - await eventListener.AssertMinimumLength(nameof(channelName),channelName,2); - await eventListener.AssertMaximumLength(nameof(channelName),channelName,64); - await eventListener.AssertRegEx(nameof(channelName),channelName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Returns a BotService Channel registration specified by the parameters. + /// + /// Regenerates secret keys and returns them for the DirectLine Channel of a particular BotService resource + /// + /// Azure Subscription ID. /// The name of the Bot resource group in the user subscription. /// The name of the Bot resource. - /// The name of the Bot resource. - /// Azure Subscription ID. + /// The name of the Channel resource for which keys are to be regenerated. + /// The parameters to provide for the created bot. /// a delegate that is 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.BotService.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 ChannelsGet(string resourceGroupName, string resourceName, string channelName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task DirectLineRegenerateKeys(string subscriptionId, string resourceGroupName, string resourceName, string channelName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInfo body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-06-15-preview"; // Constant Parameters @@ -2951,6 +7135,7 @@ public partial class BotService + global::System.Uri.EscapeDataString(resourceName) + "/channels/" + global::System.Uri.EscapeDataString(channelName) + + "/regeneratekeys" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -2959,26 +7144,34 @@ public partial class BotService // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ChannelsGet_Call(request,onOk,onDefault,eventListener,sender); + await this.DirectLineRegenerateKeys_Call (request, onOk,onDefault,eventListener,sender); } } - /// Returns a BotService Channel registration specified by the parameters. + /// + /// Regenerates secret keys and returns them for the DirectLine Channel of a particular BotService resource + /// /// + /// The parameters to provide for the created bot. /// a delegate that is 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.BotService.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 ChannelsGetViaIdentity(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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task DirectLineRegenerateKeysViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInfo body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-06-15-preview"; // Constant Parameters @@ -2993,10 +7186,10 @@ public partial class BotService } // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var resourceName = _match.Groups["resourceName"].Value; var channelName = _match.Groups["channelName"].Value; - var subscriptionId = _match.Groups["subscriptionId"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -3007,6 +7200,7 @@ public partial class BotService + resourceName + "/channels/" + channelName + + "/regeneratekeys" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -3015,109 +7209,151 @@ public partial class BotService // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ChannelsGet_Call(request,onOk,onDefault,eventListener,sender); + await this.DirectLineRegenerateKeys_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). + /// + /// Regenerates secret keys and returns them for the DirectLine Channel of a particular BotService resource + /// + /// + /// The parameters to provide for the created bot. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 ChannelsGet_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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task DirectLineRegenerateKeysViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInfo body, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2022-06-15-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.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.BotChannel.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.BotService/botServices/(?[^/]+)/channels/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/channels/{channelName}'"); } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var resourceName = _match.Groups["resourceName"].Value; + var channelName = _match.Groups["channelName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.BotService/botServices/" + + resourceName + + "/channels/" + + channelName + + "/regeneratekeys" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.DirectLineRegenerateKeysWithResult_Call (request, eventListener,sender); } } /// - /// Validation method for method. Call this like the actual call, but you will get validation events - /// back. + /// Regenerates secret keys and returns them for the DirectLine Channel of a particular BotService resource /// + /// Azure Subscription ID. /// The name of the Bot resource group in the user subscription. /// The name of the Bot resource. - /// The name of the Bot resource. - /// Azure Subscription ID. + /// The name of the Channel resource for which keys are to be regenerated. + /// Json string supplied to the DirectLineRegenerateKeys 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.BotService.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 ChannelsGet_Validate(string resourceGroupName, string resourceName, string channelName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener) + public async global::System.Threading.Tasks.Task DirectLineRegenerateKeysViaJsonString(string subscriptionId, string resourceGroupName, string resourceName, string channelName, 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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { + var apiVersion = @"2022-06-15-preview"; + // Constant Parameters using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,2); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,64); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); - await eventListener.AssertNotNull(nameof(resourceName),resourceName); - await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,2); - await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,64); - await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); - await eventListener.AssertNotNull(nameof(channelName),channelName); - await eventListener.AssertMinimumLength(nameof(channelName),channelName,2); - await eventListener.AssertMaximumLength(nameof(channelName),channelName,64); - await eventListener.AssertRegEx(nameof(channelName),channelName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.BotService/botServices/" + + global::System.Uri.EscapeDataString(resourceName) + + "/channels/" + + global::System.Uri.EscapeDataString(channelName) + + "/regeneratekeys" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DirectLineRegenerateKeys_Call (request, onOk,onDefault,eventListener,sender); } } - /// Returns all the Channel registrations of a particular BotService resource + /// + /// Regenerates secret keys and returns them for the DirectLine Channel of a particular BotService resource + /// + /// Azure Subscription ID. /// The name of the Bot resource group in the user subscription. /// The name of the Bot resource. - /// Azure Subscription ID. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// The name of the Channel resource for which keys are to be regenerated. + /// Json string supplied to the DirectLineRegenerateKeys operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 ChannelsListByResourceGroup(string resourceGroupName, string resourceName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task DirectLineRegenerateKeysViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string resourceName, string channelName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { var apiVersion = @"2022-06-15-preview"; // Constant Parameters @@ -3131,79 +7367,144 @@ public partial class BotService + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.BotService/botServices/" + global::System.Uri.EscapeDataString(resourceName) - + "/channels" + + "/channels/" + + global::System.Uri.EscapeDataString(channelName) + + "/regeneratekeys" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ChannelsListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + return await this.DirectLineRegenerateKeysWithResult_Call (request, eventListener,sender); } } - /// Returns all the Channel registrations of a particular BotService 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). + /// + /// Regenerates secret keys and returns them for the DirectLine Channel of a particular BotService resource + /// + /// Azure Subscription ID. + /// The name of the Bot resource group in the user subscription. + /// The name of the Bot resource. + /// The name of the Channel resource for which keys are to be regenerated. + /// The parameters to provide for the created bot. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 ChannelsListByResourceGroupViaIdentity(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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task DirectLineRegenerateKeysWithResult(string subscriptionId, string resourceGroupName, string resourceName, string channelName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInfo body, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-06-15-preview"; // 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.BotService/botServices/(?[^/]+)/channels$", 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.BotService/botServices/{resourceName}/channels'"); - } - - // replace URI parameters with values from identity - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var resourceName = _match.Groups["resourceName"].Value; - var subscriptionId = _match.Groups["subscriptionId"].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.BotService/botServices/" - + resourceName - + "/channels" + + global::System.Uri.EscapeDataString(resourceName) + + "/channels/" + + global::System.Uri.EscapeDataString(channelName) + + "/regeneratekeys" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ChannelsListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + return await this.DirectLineRegenerateKeysWithResult_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.BotService.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 DirectLineRegenerateKeysWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.BotChannel.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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.BotService.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 @@ -3213,7 +7514,7 @@ public partial class BotService /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ChannelsListByResourceGroup_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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task DirectLineRegenerateKeys_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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -3224,6 +7525,7 @@ public partial class BotService await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -3231,13 +7533,13 @@ public partial class BotService case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ChannelResponseList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.BotChannel.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -3253,37 +7555,41 @@ public partial class BotService } /// - /// 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. /// + /// Azure Subscription ID. /// The name of the Bot resource group in the user subscription. /// The name of the Bot resource. - /// Azure Subscription ID. + /// The name of the Channel resource for which keys are to be regenerated. + /// The parameters to provide for the created bot. /// 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 ChannelsListByResourceGroup_Validate(string resourceGroupName, string resourceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task DirectLineRegenerateKeys_Validate(string subscriptionId, string resourceGroupName, string resourceName, string channelName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInfo body, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,2); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,64); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); await eventListener.AssertNotNull(nameof(resourceName),resourceName); await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,2); await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,64); - await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(resourceName), resourceName, @"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + await eventListener.AssertNotNull(nameof(channelName),channelName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Lists a Channel registration for a Bot Service including secrets + /// create an email channel sign in url for a Bot Service + /// Azure Subscription ID. /// The name of the Bot resource group in the user subscription. /// The name of the Bot resource. - /// The name of the Channel resource. - /// Azure Subscription ID. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -3292,7 +7598,7 @@ public partial class BotService /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ChannelsListWithKeys(string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.ChannelName channelName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task EmailCreateSignInUrl(string subscriptionId, string resourceGroupName, string resourceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { var apiVersion = @"2022-06-15-preview"; // Constant Parameters @@ -3306,9 +7612,7 @@ public partial class BotService + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.BotService/botServices/" + global::System.Uri.EscapeDataString(resourceName) - + "/channels/" - + global::System.Uri.EscapeDataString(channelName) - + "/listChannelWithKeys" + + "/createEmailSignInUrl" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -3322,11 +7626,11 @@ public partial class BotService await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ChannelsListWithKeys_Call(request,onOk,onDefault,eventListener,sender); + await this.EmailCreateSignInUrl_Call (request, onOk,onDefault,eventListener,sender); } } - /// Lists a Channel registration for a Bot Service including secrets + /// create an email channel sign in url for a Bot Service /// /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -3336,7 +7640,7 @@ public partial class BotService /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ChannelsListWithKeysViaIdentity(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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task EmailCreateSignInUrlViaIdentity(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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { var apiVersion = @"2022-06-15-preview"; // Constant Parameters @@ -3344,17 +7648,16 @@ public partial class BotService { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.BotService/botServices/(?[^/]+)/channels/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.BotService/botServices/(?[^/]+)$", 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.BotService/botServices/{resourceName}/channels/{channelName}/listChannelWithKeys'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}'"); } // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var resourceName = _match.Groups["resourceName"].Value; - var channelName = _match.Groups["channelName"].Value; - var subscriptionId = _match.Groups["subscriptionId"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -3363,9 +7666,7 @@ public partial class BotService + resourceGroupName + "/providers/Microsoft.BotService/botServices/" + resourceName - + "/channels/" - + channelName - + "/listChannelWithKeys" + + "/createEmailSignInUrl" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -3379,11 +7680,165 @@ public partial class BotService await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ChannelsListWithKeys_Call(request,onOk,onDefault,eventListener,sender); + await this.EmailCreateSignInUrl_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// create an email channel sign in url for a Bot Service + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 EmailCreateSignInUrlViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-06-15-preview"; + // 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.BotService/botServices/(?[^/]+)$", 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.BotService/botServices/{resourceName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var resourceName = _match.Groups["resourceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.BotService/botServices/" + + resourceName + + "/createEmailSignInUrl" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.EmailCreateSignInUrlWithResult_Call (request, eventListener,sender); + } + } + + /// create an email channel sign in url for a Bot Service + /// Azure Subscription ID. + /// The name of the Bot resource group in the user subscription. + /// The name of the Bot resource. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 EmailCreateSignInUrlWithResult(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-06-15-preview"; + // 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.BotService/botServices/" + + global::System.Uri.EscapeDataString(resourceName) + + "/createEmailSignInUrl" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.EmailCreateSignInUrlWithResult_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.BotService.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 EmailCreateSignInUrlWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.CreateEmailSignInUrlResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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.BotService.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 @@ -3393,7 +7848,7 @@ public partial class BotService /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ChannelsListWithKeys_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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task EmailCreateSignInUrl_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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -3404,6 +7859,7 @@ public partial class BotService await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -3411,13 +7867,13 @@ public partial class BotService case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ListChannelWithKeysResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.CreateEmailSignInUrlResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -3433,43 +7889,37 @@ public partial class BotService } /// - /// Validation method for method. Call this like the actual call, but you will get validation + /// Validation method for method. Call this like the actual call, but you will get validation /// events back. /// + /// Azure Subscription ID. /// The name of the Bot resource group in the user subscription. /// The name of the Bot resource. - /// The name of the Channel resource. - /// Azure Subscription ID. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ChannelsListWithKeys_Validate(string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.ChannelName channelName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task EmailCreateSignInUrl_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,2); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,64); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); await eventListener.AssertNotNull(nameof(resourceName),resourceName); await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,2); await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,64); - await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); - await eventListener.AssertNotNull(nameof(channelName),channelName); - await eventListener.AssertEnum(nameof(channelName),channelName,@"AlexaChannel", @"FacebookChannel", @"EmailChannel", @"KikChannel", @"TelegramChannel", @"SlackChannel", @"MsTeamsChannel", @"SkypeChannel", @"WebChatChannel", @"DirectLineChannel", @"SmsChannel", @"LineChannel", @"DirectLineSpeechChannel", @"OutlookChannel", @"Omnichannel", @"TelephonyChannel"); - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(resourceName), resourceName, @"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); } } - /// Updates a Channel registration for a Bot Service - /// The name of the Bot resource group in the user subscription. - /// The name of the Bot resource. - /// The name of the Channel resource. + /// + /// Get per subscription settings needed to host bot in compute resource such as Azure App Service + /// /// Azure Subscription ID. - /// The parameters to provide for the created bot. /// 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. @@ -3477,7 +7927,7 @@ public partial class BotService /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ChannelsUpdate(string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.ChannelName channelName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannel 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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task HostSettingsGet(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { var apiVersion = @"2022-06-15-preview"; // Constant Parameters @@ -3487,12 +7937,7 @@ public partial class BotService var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + global::System.Uri.EscapeDataString(subscriptionId) - + "/resourceGroups/" - + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.BotService/botServices/" - + global::System.Uri.EscapeDataString(resourceName) - + "/channels/" - + global::System.Uri.EscapeDataString(channelName) + + "/providers/Microsoft.BotService/hostSettings" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -3501,24 +7946,20 @@ public partial class BotService // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ChannelsUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + await this.HostSettingsGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Updates a Channel registration for a Bot Service + /// + /// Get per subscription settings needed to host bot in compute resource such as Azure App Service + /// /// - /// The parameters to provide for the created bot. /// 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. @@ -3526,7 +7967,7 @@ public partial class BotService /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ChannelsUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannel 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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task HostSettingsGetViaIdentity(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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { var apiVersion = @"2022-06-15-preview"; // Constant Parameters @@ -3534,52 +7975,185 @@ public partial class BotService { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.BotService/botServices/(?[^/]+)/channels/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.BotService/hostSettings$", 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.BotService/botServices/{resourceName}/channels/{channelName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.BotService/hostSettings'"); + } + + // 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.BotService/hostSettings" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.HostSettingsGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Get per subscription settings needed to host bot in compute resource such as Azure App Service + /// + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 HostSettingsGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-06-15-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.BotService/hostSettings$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.BotService/hostSettings'"); } // replace URI parameters with values from identity - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var resourceName = _match.Groups["resourceName"].Value; - var channelName = _match.Groups["channelName"].Value; var subscriptionId = _match.Groups["subscriptionId"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.BotService/botServices/" - + resourceName - + "/channels/" - + channelName + + subscriptionId + + "/providers/Microsoft.BotService/hostSettings" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.HostSettingsGetWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Get per subscription settings needed to host bot in compute resource such as Azure App Service + /// + /// Azure Subscription ID. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 HostSettingsGetWithResult(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-06-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.BotService/hostSettings" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ChannelsUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + return await this.HostSettingsGetWithResult_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.BotService.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 HostSettingsGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.HostSettingsResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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.BotService.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). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -3587,7 +8161,7 @@ public partial class BotService /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ChannelsUpdate_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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task HostSettingsGet_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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -3598,6 +8172,7 @@ public partial class BotService await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -3605,19 +8180,13 @@ public partial class BotService case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.BotChannel.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - case global::System.Net.HttpStatusCode.Created: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.BotChannel.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.HostSettingsResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -3633,46 +8202,23 @@ public partial class BotService } /// - /// Validation method for method. Call this like the actual call, but you will get validation + /// Validation method for method. Call this like the actual call, but you will get validation /// events back. /// - /// The name of the Bot resource group in the user subscription. - /// The name of the Bot resource. - /// The name of the Channel resource. /// Azure Subscription ID. - /// The parameters to provide for the created bot. /// 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 ChannelsUpdate_Validate(string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.ChannelName channelName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannel body, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task HostSettingsGet_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,2); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,64); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); - await eventListener.AssertNotNull(nameof(resourceName),resourceName); - await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,2); - await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,64); - await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); - await eventListener.AssertNotNull(nameof(channelName),channelName); - await eventListener.AssertEnum(nameof(channelName),channelName,@"AlexaChannel", @"FacebookChannel", @"EmailChannel", @"KikChannel", @"TelegramChannel", @"SlackChannel", @"MsTeamsChannel", @"SkypeChannel", @"WebChatChannel", @"DirectLineChannel", @"SmsChannel", @"LineChannel", @"DirectLineSpeechChannel", @"OutlookChannel", @"Omnichannel", @"TelephonyChannel"); await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// - /// Regenerates secret keys and returns them for the DirectLine Channel of a particular BotService resource - /// - /// The name of the Bot resource group in the user subscription. - /// The name of the Bot resource. - /// Azure Subscription ID. - /// The name of the Channel resource for which keys are to be regenerated. - /// The parameters to provide for the created bot. + /// Lists all the available BotService operations. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -3681,7 +8227,7 @@ public partial class BotService /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task DirectLineRegenerateKeys(string resourceGroupName, string resourceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.RegenerateKeysChannelName channelName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInfo body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task OperationsList(global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { var apiVersion = @"2022-06-15-preview"; // Constant Parameters @@ -3689,15 +8235,7 @@ public partial class BotService { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + global::System.Uri.EscapeDataString(subscriptionId) - + "/resourceGroups/" - + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.BotService/botServices/" - + global::System.Uri.EscapeDataString(resourceName) - + "/channels/" - + global::System.Uri.EscapeDataString(channelName) - + "/regeneratekeys" + "/providers/Microsoft.BotService/operations" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -3706,24 +8244,17 @@ public partial class BotService // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Post, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.DirectLineRegenerateKeys_Call(request,onOk,onDefault,eventListener,sender); + await this.OperationsList_Call (request, onOk,onDefault,eventListener,sender); } } - /// - /// Regenerates secret keys and returns them for the DirectLine Channel of a particular BotService resource - /// + /// Lists all the available BotService operations. /// - /// The parameters to provide for the created bot. /// a delegate that is 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). @@ -3732,7 +8263,7 @@ public partial class BotService /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task DirectLineRegenerateKeysViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInfo body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task OperationsListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { var apiVersion = @"2022-06-15-preview"; // Constant Parameters @@ -3740,28 +8271,16 @@ public partial class BotService { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.BotService/botServices/(?[^/]+)/channels/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.BotService/operations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/channels/{channelName}/regeneratekeys'"); + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.BotService/operations'"); } // replace URI parameters with values from identity - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var resourceName = _match.Groups["resourceName"].Value; - var subscriptionId = _match.Groups["subscriptionId"].Value; - var channelName = _match.Groups["channelName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.BotService/botServices/" - + resourceName - + "/channels/" - + channelName - + "/regeneratekeys" + "/providers/Microsoft.BotService/operations" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -3770,114 +8289,66 @@ public partial class BotService // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Post, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.DirectLineRegenerateKeys_Call(request,onOk,onDefault,eventListener,sender); + await this.OperationsList_Call (request, onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Lists all the available BotService operations. + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 DirectLineRegenerateKeys_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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task OperationsListViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { + var apiVersion = @"2022-06-15-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.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.BotChannel.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.BotService/operations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.BotService/operations'"); } - } - } - /// - /// Validation method for method. Call this like the actual call, but you will get - /// validation events back. - /// - /// The name of the Bot resource group in the user subscription. - /// The name of the Bot resource. - /// Azure Subscription ID. - /// The name of the Channel resource for which keys are to be regenerated. - /// The parameters to provide for the created bot. - /// 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 DirectLineRegenerateKeys_Validate(string resourceGroupName, string resourceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.RegenerateKeysChannelName channelName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInfo body, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,2); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,64); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); - await eventListener.AssertNotNull(nameof(resourceName),resourceName); - await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,2); - await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,64); - await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertNotNull(nameof(channelName),channelName); - await eventListener.AssertEnum(nameof(channelName),channelName,@"WebChatChannel", @"DirectLineChannel"); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); + // replace URI parameters with values from identity + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.BotService/operations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.OperationsListWithResult_Call (request, eventListener,sender); } } - /// Creates an email channel sign in url for a Bot Service - /// The name of the Bot resource group in the user subscription. - /// The name of the Bot resource. - /// Azure Subscription ID. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Lists all the available BotService operations. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 EmailCreateSignInUrl(string resourceGroupName, string resourceName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task OperationsListWithResult(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { var apiVersion = @"2022-06-15-preview"; // Constant Parameters @@ -3885,85 +8356,85 @@ public partial class BotService { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + global::System.Uri.EscapeDataString(subscriptionId) - + "/resourceGroups/" - + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.BotService/botServices/" - + global::System.Uri.EscapeDataString(resourceName) - + "/createEmailSignInUrl" + "/providers/Microsoft.BotService/operations" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.EmailCreateSignInUrl_Call(request,onOk,onDefault,eventListener,sender); + return await this.OperationsListWithResult_Call (request, eventListener,sender); } } - /// Creates an email channel sign in url for a Bot Service - /// - /// a delegate that is 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.BotService.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 EmailCreateSignInUrlViaIdentity(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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task OperationsListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { - var apiVersion = @"2022-06-15-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.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.BotService/botServices/(?[^/]+)$", 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.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.OperationEntityListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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 '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/createEmailSignInUrl'"); + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); } - - // replace URI parameters with values from identity - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var resourceName = _match.Groups["resourceName"].Value; - var subscriptionId = _match.Groups["subscriptionId"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.BotService/botServices/" - + resourceName - + "/createEmailSignInUrl" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.EmailCreateSignInUrl_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 @@ -3973,7 +8444,7 @@ public partial class BotService /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task EmailCreateSignInUrl_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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task OperationsList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -3984,6 +8455,7 @@ public partial class BotService await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -3991,13 +8463,13 @@ public partial class BotService case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.CreateEmailSignInUrlResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.OperationEntityListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -4013,45 +8485,39 @@ public partial class BotService } /// - /// Validation method for method. Call this like the actual call, but you will get validation + /// Validation method for method. Call this like the actual call, but you will get validation /// events back. /// - /// The name of the Bot resource group in the user subscription. - /// The name of the Bot resource. - /// Azure Subscription ID. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task EmailCreateSignInUrl_Validate(string resourceGroupName, string resourceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task OperationsList_Validate(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,2); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,64); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); - await eventListener.AssertNotNull(nameof(resourceName),resourceName); - await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,2); - await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,64); - await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + } } /// - /// Get per subscription settings needed to host bot in compute resource such as Azure App Service + /// update the state of specified private endpoint connection associated with the Bot. /// /// Azure Subscription ID. + /// The name of the Bot resource group in the user subscription. + /// The name of the Bot resource. + /// The name of the private endpoint connection associated with the Azure resource + /// The private endpoint connection properties. /// a delegate that is 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.BotService.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 HostSettingsGet(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsCreate(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnection body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-06-15-preview"; // Constant Parameters @@ -4061,7 +8527,12 @@ public partial class BotService var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + global::System.Uri.EscapeDataString(subscriptionId) - + "/providers/Microsoft.BotService/hostSettings" + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.BotService/botServices/" + + global::System.Uri.EscapeDataString(resourceName) + + "/privateEndpointConnections/" + + global::System.Uri.EscapeDataString(privateEndpointConnectionName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -4070,28 +8541,34 @@ public partial class BotService // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.HostSettingsGet_Call(request,onOk,onDefault,eventListener,sender); + await this.PrivateEndpointConnectionsCreate_Call (request, onOk,onDefault,eventListener,sender); } } /// - /// Get per subscription settings needed to host bot in compute resource such as Azure App Service + /// update the state of specified private endpoint connection associated with the Bot. /// /// + /// The private endpoint connection properties. /// a delegate that is 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.BotService.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 HostSettingsGetViaIdentity(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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsCreateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnection body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-06-15-preview"; // Constant Parameters @@ -4099,19 +8576,27 @@ public partial class BotService { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.BotService/hostSettings$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.BotService/botServices/(?[^/]+)/privateEndpointConnections/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.BotService/hostSettings'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var resourceName = _match.Groups["resourceName"].Value; + var privateEndpointConnectionName = _match.Groups["privateEndpointConnectionName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId - + "/providers/Microsoft.BotService/hostSettings" + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.BotService/botServices/" + + resourceName + + "/privateEndpointConnections/" + + privateEndpointConnectionName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -4120,17 +8605,89 @@ public partial class BotService // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.HostSettingsGet_Call(request,onOk,onDefault,eventListener,sender); + await this.PrivateEndpointConnectionsCreate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. + /// + /// update the state of specified private endpoint connection associated with the Bot. + /// + /// + /// The private endpoint connection properties. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 PrivateEndpointConnectionsCreateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnection body, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2022-06-15-preview"; + // 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.BotService/botServices/(?[^/]+)/privateEndpointConnections/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var resourceName = _match.Groups["resourceName"].Value; + var privateEndpointConnectionName = _match.Groups["privateEndpointConnectionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.BotService/botServices/" + + resourceName + + "/privateEndpointConnections/" + + privateEndpointConnectionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.PrivateEndpointConnectionsCreateWithResult_Call (request, eventListener,sender); + } + } + + /// + /// update the state of specified private endpoint connection associated with the Bot. + /// + /// Azure Subscription ID. + /// The name of the Bot resource group in the user subscription. + /// The name of the Bot resource. + /// The name of the private endpoint connection associated with the Azure resource + /// Json string supplied to the PrivateEndpointConnectionsCreate 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). @@ -4139,72 +8696,110 @@ public partial class BotService /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task HostSettingsGet_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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsCreateViaJsonString(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, 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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { + var apiVersion = @"2022-06-15-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.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.BotService/botServices/" + + global::System.Uri.EscapeDataString(resourceName) + + "/privateEndpointConnections/" + + global::System.Uri.EscapeDataString(privateEndpointConnectionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.HostSettingsResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); - } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateEndpointConnectionsCreate_Call (request, onOk,onDefault,eventListener,sender); } } /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. + /// update the state of specified private endpoint connection associated with the Bot. /// /// Azure Subscription ID. + /// The name of the Bot resource group in the user subscription. + /// The name of the Bot resource. + /// The name of the private endpoint connection associated with the Azure resource + /// Json string supplied to the PrivateEndpointConnectionsCreate operation /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 HostSettingsGet_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener) + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsCreateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { + var apiVersion = @"2022-06-15-preview"; + // Constant Parameters using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.BotService/botServices/" + + global::System.Uri.EscapeDataString(resourceName) + + "/privateEndpointConnections/" + + global::System.Uri.EscapeDataString(privateEndpointConnectionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.PrivateEndpointConnectionsCreateWithResult_Call (request, eventListener,sender); } } - /// Lists all the available BotService operations. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// + /// update the state of specified private endpoint connection associated with the Bot. + /// + /// Azure Subscription ID. + /// The name of the Bot resource group in the user subscription. + /// The name of the Bot resource. + /// The name of the private endpoint connection associated with the Azure resource + /// The private endpoint connection properties. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 OperationsList(global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsCreateWithResult(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnection body, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-06-15-preview"; // Constant Parameters @@ -4212,70 +8807,98 @@ public partial class BotService { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/providers/Microsoft.BotService/operations" + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.BotService/botServices/" + + global::System.Uri.EscapeDataString(resourceName) + + "/privateEndpointConnections/" + + global::System.Uri.EscapeDataString(privateEndpointConnectionName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.OperationsList_Call(request,onOk,onDefault,eventListener,sender); + return await this.PrivateEndpointConnectionsCreateWithResult_Call (request, eventListener,sender); } } - /// Lists all the available BotService operations. - /// - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 OperationsListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionsCreateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { - var apiVersion = @"2022-06-15-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.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService/operations$", 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.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.PrivateEndpointConnection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally { - throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.BotService/operations'"); + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); } - - // replace URI parameters with values from identity - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/providers/Microsoft.BotService/operations" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.OperationsList_Call(request,onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. + /// 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 @@ -4285,7 +8908,7 @@ public partial class BotService /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task OperationsList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionsCreate_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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -4296,6 +8919,7 @@ public partial class BotService await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -4303,13 +8927,13 @@ public partial class BotService case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.OperationEntityListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.PrivateEndpointConnection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -4325,30 +8949,44 @@ public partial class BotService } /// - /// 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. /// + /// Azure Subscription ID. + /// The name of the Bot resource group in the user subscription. + /// The name of the Bot resource. + /// The name of the private endpoint connection associated with the Azure resource + /// The private endpoint connection properties. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task OperationsList_Validate(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionsCreate_Validate(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnection body, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { - + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,2); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,64); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + await eventListener.AssertNotNull(nameof(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,2); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,64); + await eventListener.AssertRegEx(nameof(resourceName), resourceName, @"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + await eventListener.AssertNotNull(nameof(privateEndpointConnectionName),privateEndpointConnectionName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// - /// Update the state of specified private endpoint connection associated with the Bot. - /// + /// Deletes the specified private endpoint connection associated with the Bot. + /// Azure Subscription ID. /// The name of the Bot resource group in the user subscription. /// The name of the Bot resource. - /// Azure Subscription ID. /// The name of the private endpoint connection associated with the Azure resource - /// The private endpoint connection properties. /// 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. @@ -4356,7 +8994,7 @@ public partial class BotService /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsCreate(string resourceGroupName, string resourceName, string subscriptionId, string privateEndpointConnectionName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnection body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsDelete(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { var apiVersion = @"2022-06-15-preview"; // Constant Parameters @@ -4380,25 +9018,19 @@ public partial class BotService // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PrivateEndpointConnectionsCreate_Call(request,onOk,onDefault,eventListener,sender); + await this.PrivateEndpointConnectionsDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } - /// - /// Update the state of specified private endpoint connection associated with the Bot. - /// + /// Deletes the specified private endpoint connection associated with the Bot. /// - /// The private endpoint connection properties. /// 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. @@ -4406,7 +9038,7 @@ public partial class BotService /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsCreateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnection body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsDeleteViaIdentity(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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { var apiVersion = @"2022-06-15-preview"; // Constant Parameters @@ -4421,9 +9053,9 @@ public partial class BotService } // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var resourceName = _match.Groups["resourceName"].Value; - var subscriptionId = _match.Groups["subscriptionId"].Value; var privateEndpointConnectionName = _match.Groups["privateEndpointConnectionName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( @@ -4443,22 +9075,19 @@ public partial class BotService // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PrivateEndpointConnectionsCreate_Call(request,onOk,onDefault,eventListener,sender); + await this.PrivateEndpointConnectionsDelete_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. @@ -4466,7 +9095,7 @@ public partial class BotService /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionsCreate_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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionsDelete_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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -4477,6 +9106,7 @@ public partial class BotService await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -4484,13 +9114,19 @@ public partial class BotService case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateEndpointConnection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -4506,44 +9142,40 @@ public partial class BotService } /// - /// 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. /// + /// Azure Subscription ID. /// The name of the Bot resource group in the user subscription. /// The name of the Bot resource. - /// Azure Subscription ID. /// The name of the private endpoint connection associated with the Azure resource - /// The private endpoint connection properties. /// 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 PrivateEndpointConnectionsCreate_Validate(string resourceGroupName, string resourceName, string subscriptionId, string privateEndpointConnectionName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnection body, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionsDelete_Validate(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,2); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,64); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); await eventListener.AssertNotNull(nameof(resourceName),resourceName); await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,2); await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,64); - await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(resourceName), resourceName, @"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); await eventListener.AssertNotNull(nameof(privateEndpointConnectionName),privateEndpointConnectionName); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Deletes the specified private endpoint connection associated with the Bot. + /// Gets the specified private endpoint connection associated with the Bot. + /// Azure Subscription ID. /// The name of the Bot resource group in the user subscription. /// The name of the Bot resource. - /// Azure Subscription ID. /// The name of the private endpoint connection associated with the Azure 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. @@ -4551,7 +9183,7 @@ public partial class BotService /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsDelete(string resourceGroupName, string resourceName, string subscriptionId, string privateEndpointConnectionName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsGet(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { var apiVersion = @"2022-06-15-preview"; // Constant Parameters @@ -4575,19 +9207,18 @@ public partial class BotService // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PrivateEndpointConnectionsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.PrivateEndpointConnectionsGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Deletes the specified private endpoint connection associated with the Bot. + /// Gets the specified private endpoint connection associated with the Bot. /// /// 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. @@ -4595,7 +9226,7 @@ public partial class BotService /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsDeleteViaIdentity(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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsGetViaIdentity(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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { var apiVersion = @"2022-06-15-preview"; // Constant Parameters @@ -4610,9 +9241,9 @@ public partial class BotService } // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var resourceName = _match.Groups["resourceName"].Value; - var subscriptionId = _match.Groups["subscriptionId"].Value; var privateEndpointConnectionName = _match.Groups["privateEndpointConnectionName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( @@ -4632,19 +9263,178 @@ public partial class BotService // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PrivateEndpointConnectionsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.PrivateEndpointConnectionsGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Gets the specified private endpoint connection associated with the Bot. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 PrivateEndpointConnectionsGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-06-15-preview"; + // 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.BotService/botServices/(?[^/]+)/privateEndpointConnections/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var resourceName = _match.Groups["resourceName"].Value; + var privateEndpointConnectionName = _match.Groups["privateEndpointConnectionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.BotService/botServices/" + + resourceName + + "/privateEndpointConnections/" + + privateEndpointConnectionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.PrivateEndpointConnectionsGetWithResult_Call (request, eventListener,sender); + } + } + + /// Gets the specified private endpoint connection associated with the Bot. + /// Azure Subscription ID. + /// The name of the Bot resource group in the user subscription. + /// The name of the Bot resource. + /// The name of the private endpoint connection associated with the Azure resource + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 PrivateEndpointConnectionsGetWithResult(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-06-15-preview"; + // 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.BotService/botServices/" + + global::System.Uri.EscapeDataString(resourceName) + + "/privateEndpointConnections/" + + global::System.Uri.EscapeDataString(privateEndpointConnectionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.PrivateEndpointConnectionsGetWithResult_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.BotService.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 PrivateEndpointConnectionsGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.PrivateEndpointConnection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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.BotService.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. @@ -4652,7 +9442,7 @@ public partial class BotService /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionsDelete_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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionsGet_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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -4663,6 +9453,7 @@ public partial class BotService await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -4670,19 +9461,13 @@ public partial class BotService case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.PrivateEndpointConnection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -4698,39 +9483,38 @@ public partial class BotService } /// - /// 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. /// + /// Azure Subscription ID. /// The name of the Bot resource group in the user subscription. /// The name of the Bot resource. - /// Azure Subscription ID. /// The name of the private endpoint connection associated with the Azure 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 PrivateEndpointConnectionsDelete_Validate(string resourceGroupName, string resourceName, string subscriptionId, string privateEndpointConnectionName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionsGet_Validate(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,2); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,64); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); await eventListener.AssertNotNull(nameof(resourceName),resourceName); await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,2); await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,64); - await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(resourceName), resourceName, @"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); await eventListener.AssertNotNull(nameof(privateEndpointConnectionName),privateEndpointConnectionName); } } - /// Gets the specified private endpoint connection associated with the Bot. + /// List all the private endpoint connections associated with the Bot. + /// Azure Subscription ID. /// The name of the Bot resource group in the user subscription. /// The name of the Bot resource. - /// Azure Subscription ID. - /// The name of the private endpoint connection associated with the Azure 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). @@ -4739,7 +9523,7 @@ public partial class BotService /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsGet(string resourceGroupName, string resourceName, string subscriptionId, string privateEndpointConnectionName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsList(string subscriptionId, string resourceGroupName, string resourceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { var apiVersion = @"2022-06-15-preview"; // Constant Parameters @@ -4753,8 +9537,7 @@ public partial class BotService + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.BotService/botServices/" + global::System.Uri.EscapeDataString(resourceName) - + "/privateEndpointConnections/" - + global::System.Uri.EscapeDataString(privateEndpointConnectionName) + + "/privateEndpointConnections" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -4768,11 +9551,11 @@ public partial class BotService await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PrivateEndpointConnectionsGet_Call(request,onOk,onDefault,eventListener,sender); + await this.PrivateEndpointConnectionsList_Call (request, onOk,onDefault,eventListener,sender); } } - /// Gets the specified private endpoint connection associated with the Bot. + /// List all the private endpoint connections associated with the Bot. /// /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -4782,7 +9565,7 @@ public partial class BotService /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsGetViaIdentity(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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsListViaIdentity(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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { var apiVersion = @"2022-06-15-preview"; // Constant Parameters @@ -4790,17 +9573,16 @@ public partial class BotService { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.BotService/botServices/(?[^/]+)/privateEndpointConnections/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.BotService/botServices/(?[^/]+)/privateEndpointConnections$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/privateEndpointConnections'"); } // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var resourceName = _match.Groups["resourceName"].Value; - var subscriptionId = _match.Groups["subscriptionId"].Value; - var privateEndpointConnectionName = _match.Groups["privateEndpointConnectionName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -4809,8 +9591,7 @@ public partial class BotService + resourceGroupName + "/providers/Microsoft.BotService/botServices/" + resourceName - + "/privateEndpointConnections/" - + privateEndpointConnectionName + + "/privateEndpointConnections" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -4824,11 +9605,167 @@ public partial class BotService await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PrivateEndpointConnectionsGet_Call(request,onOk,onDefault,eventListener,sender); + await this.PrivateEndpointConnectionsList_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// List all the private endpoint connections associated with the Bot. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 PrivateEndpointConnectionsListViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-06-15-preview"; + // 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.BotService/botServices/(?[^/]+)/privateEndpointConnections$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/privateEndpointConnections'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var resourceName = _match.Groups["resourceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.BotService/botServices/" + + resourceName + + "/privateEndpointConnections" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.PrivateEndpointConnectionsListWithResult_Call (request, eventListener,sender); + } + } + + /// List all the private endpoint connections associated with the Bot. + /// Azure Subscription ID. + /// The name of the Bot resource group in the user subscription. + /// The name of the Bot resource. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 PrivateEndpointConnectionsListWithResult(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-06-15-preview"; + // 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.BotService/botServices/" + + global::System.Uri.EscapeDataString(resourceName) + + "/privateEndpointConnections" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.PrivateEndpointConnectionsListWithResult_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.BotService.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 PrivateEndpointConnectionsListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.PrivateEndpointConnectionListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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.BotService.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 @@ -4838,7 +9775,7 @@ public partial class BotService /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionsGet_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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionsList_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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -4849,6 +9786,7 @@ public partial class BotService await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -4856,13 +9794,13 @@ public partial class BotService case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateEndpointConnection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.PrivateEndpointConnectionListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -4878,38 +9816,36 @@ public partial class BotService } /// - /// Validation method for method. Call this like the actual call, but you will + /// Validation method for method. Call this like the actual call, but you will /// get validation events back. /// + /// Azure Subscription ID. /// The name of the Bot resource group in the user subscription. /// The name of the Bot resource. - /// Azure Subscription ID. - /// The name of the private endpoint connection associated with the Azure 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 PrivateEndpointConnectionsGet_Validate(string resourceGroupName, string resourceName, string subscriptionId, string privateEndpointConnectionName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionsList_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,2); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,64); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); await eventListener.AssertNotNull(nameof(resourceName),resourceName); await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,2); await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,64); - await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertNotNull(nameof(privateEndpointConnectionName),privateEndpointConnectionName); + await eventListener.AssertRegEx(nameof(resourceName), resourceName, @"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); } } - /// List all the private endpoint connections associated with the Bot. + /// Gets the private link resources that need to be created for a Bot. + /// Azure Subscription ID. /// The name of the Bot resource group in the user subscription. /// The name of the Bot resource. - /// Azure Subscription ID. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -4918,7 +9854,7 @@ public partial class BotService /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsList(string resourceGroupName, string resourceName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateLinkResourcesListByBotResource(string subscriptionId, string resourceGroupName, string resourceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { var apiVersion = @"2022-06-15-preview"; // Constant Parameters @@ -4932,7 +9868,7 @@ public partial class BotService + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.BotService/botServices/" + global::System.Uri.EscapeDataString(resourceName) - + "/privateEndpointConnections" + + "/privateLinkResources" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -4946,11 +9882,11 @@ public partial class BotService await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PrivateEndpointConnectionsList_Call(request,onOk,onDefault,eventListener,sender); + await this.PrivateLinkResourcesListByBotResource_Call (request, onOk,onDefault,eventListener,sender); } } - /// List all the private endpoint connections associated with the Bot. + /// Gets the private link resources that need to be created for a Bot. /// /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -4960,7 +9896,7 @@ public partial class BotService /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsListViaIdentity(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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateLinkResourcesListByBotResourceViaIdentity(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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { var apiVersion = @"2022-06-15-preview"; // Constant Parameters @@ -4968,16 +9904,68 @@ public partial class BotService { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.BotService/botServices/(?[^/]+)/privateEndpointConnections$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.BotService/botServices/(?[^/]+)/privateLinkResources$", 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.BotService/botServices/{resourceName}/privateEndpointConnections'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/privateLinkResources'"); } // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var resourceName = _match.Groups["resourceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.BotService/botServices/" + + resourceName + + "/privateLinkResources" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateLinkResourcesListByBotResource_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Gets the private link resources that need to be created for a Bot. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 PrivateLinkResourcesListByBotResourceViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-06-15-preview"; + // 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.BotService/botServices/(?[^/]+)/privateLinkResources$", 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.BotService/botServices/{resourceName}/privateLinkResources'"); + } + + // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var resourceName = _match.Groups["resourceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -4986,25 +9974,131 @@ public partial class BotService + resourceGroupName + "/providers/Microsoft.BotService/botServices/" + resourceName - + "/privateEndpointConnections" + + "/privateLinkResources" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.PrivateLinkResourcesListByBotResourceWithResult_Call (request, eventListener,sender); + } + } + + /// Gets the private link resources that need to be created for a Bot. + /// Azure Subscription ID. + /// The name of the Bot resource group in the user subscription. + /// The name of the Bot resource. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 PrivateLinkResourcesListByBotResourceWithResult(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-06-15-preview"; + // 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.BotService/botServices/" + + global::System.Uri.EscapeDataString(resourceName) + + "/privateLinkResources" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.PrivateEndpointConnectionsList_Call(request,onOk,onDefault,eventListener,sender); + return await this.PrivateLinkResourcesListByBotResourceWithResult_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.BotService.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 PrivateLinkResourcesListByBotResourceWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.PrivateLinkResourceListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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.BotService.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 @@ -5014,7 +10108,7 @@ public partial class BotService /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionsList_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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task PrivateLinkResourcesListByBotResource_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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -5025,6 +10119,7 @@ public partial class BotService await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -5032,13 +10127,13 @@ public partial class BotService case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateEndpointConnectionListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.PrivateLinkResourceListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -5054,45 +10149,45 @@ public partial class BotService } /// - /// 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. /// + /// Azure Subscription ID. /// The name of the Bot resource group in the user subscription. /// The name of the Bot resource. - /// Azure Subscription ID. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionsList_Validate(string resourceGroupName, string resourceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task PrivateLinkResourcesListByBotResource_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,2); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,64); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); await eventListener.AssertNotNull(nameof(resourceName),resourceName); await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,2); await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,64); - await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(resourceName), resourceName, @"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); } } - /// Gets the private link resources that need to be created for a Bot. - /// The name of the Bot resource group in the user subscription. - /// The name of the Bot resource. + /// Lists the QnA Maker endpoint keys /// Azure Subscription ID. + /// The request body parameters to provide for the check name availability 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.BotService.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 PrivateLinkResourcesListByBotResource(string resourceGroupName, string resourceName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task QnAMakerEndpointKeysGet(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysRequestBody body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-06-15-preview"; // Constant Parameters @@ -5102,11 +10197,7 @@ public partial class BotService var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + global::System.Uri.EscapeDataString(subscriptionId) - + "/resourceGroups/" - + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.BotService/botServices/" - + global::System.Uri.EscapeDataString(resourceName) - + "/privateLinkResources" + + "/providers/Microsoft.BotService/listQnAMakerEndpointKeys" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -5115,26 +10206,32 @@ public partial class BotService // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PrivateLinkResourcesListByBotResource_Call(request,onOk,onDefault,eventListener,sender); + await this.QnAMakerEndpointKeysGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Gets the private link resources that need to be created for a Bot. + /// Lists the QnA Maker endpoint keys /// + /// The request body parameters to provide for the check name availability 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.BotService.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 PrivateLinkResourcesListByBotResourceViaIdentity(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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task QnAMakerEndpointKeysGetViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysRequestBody body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-06-15-preview"; // Constant Parameters @@ -5142,25 +10239,19 @@ public partial class BotService { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.BotService/botServices/(?[^/]+)/privateLinkResources$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.BotService$", 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.BotService/botServices/{resourceName}/privateLinkResources'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.BotService'"); } // replace URI parameters with values from identity - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var resourceName = _match.Groups["resourceName"].Value; var subscriptionId = _match.Groups["subscriptionId"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.BotService/botServices/" - + resourceName - + "/privateLinkResources" + + "/providers/Microsoft.BotService/listQnAMakerEndpointKeys" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -5169,105 +10260,124 @@ public partial class BotService // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PrivateLinkResourcesListByBotResource_Call(request,onOk,onDefault,eventListener,sender); + await this.QnAMakerEndpointKeysGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// - /// Actual wire call for method. - /// - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Lists the QnA Maker endpoint keys + /// + /// The request body parameters to provide for the check name availability request /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 PrivateLinkResourcesListByBotResource_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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task QnAMakerEndpointKeysGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysRequestBody body, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2022-06-15-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.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateLinkResourceListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.BotService$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.BotService'"); } + + // 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.BotService/listQnAMakerEndpointKeys" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.QnAMakerEndpointKeysGetWithResult_Call (request, eventListener,sender); } } - /// - /// Validation method for method. Call this like the actual call, but - /// you will get validation events back. - /// - /// The name of the Bot resource group in the user subscription. - /// The name of the Bot resource. + /// Lists the QnA Maker endpoint keys /// Azure Subscription ID. + /// Json string supplied to the QnAMakerEndpointKeysGet 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.BotService.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 PrivateLinkResourcesListByBotResource_Validate(string resourceGroupName, string resourceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener) + public async global::System.Threading.Tasks.Task QnAMakerEndpointKeysGetViaJsonString(string subscriptionId, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { + var apiVersion = @"2022-06-15-preview"; + // Constant Parameters using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,2); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,64); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); - await eventListener.AssertNotNull(nameof(resourceName),resourceName); - await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,2); - await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,64); - await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.BotService/listQnAMakerEndpointKeys" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.QnAMakerEndpointKeysGet_Call (request, onOk,onDefault,eventListener,sender); } } /// Lists the QnA Maker endpoint keys /// Azure Subscription ID. - /// The request body parameters to provide for the check name availability 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). + /// Json string supplied to the QnAMakerEndpointKeysGet operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.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 QnAMakerEndpointKeysGet(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysRequestBody body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task QnAMakerEndpointKeysGetViaJsonStringWithResult(string subscriptionId, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { var apiVersion = @"2022-06-15-preview"; // Constant Parameters @@ -5282,77 +10392,126 @@ public partial class BotService + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.QnAMakerEndpointKeysGet_Call(request,onOk,onDefault,eventListener,sender); + return await this.QnAMakerEndpointKeysGetWithResult_Call (request, eventListener,sender); } } /// Lists the QnA Maker endpoint keys - /// + /// Azure Subscription ID. /// The request body parameters to provide for the check name availability 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.BotService.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 QnAMakerEndpointKeysGetViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysRequestBody body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task QnAMakerEndpointKeysGetWithResult(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysRequestBody body, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-06-15-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.BotService$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.BotService/listQnAMakerEndpointKeys'"); - } - - // 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 + + global::System.Uri.EscapeDataString(subscriptionId) + "/providers/Microsoft.BotService/listQnAMakerEndpointKeys" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.QnAMakerEndpointKeysGet_Call(request,onOk,onDefault,eventListener,sender); + return await this.QnAMakerEndpointKeysGetWithResult_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.BotService.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 QnAMakerEndpointKeysGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.QnAMakerEndpointKeysResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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.BotService.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 @@ -5362,7 +10521,7 @@ public partial class BotService /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task QnAMakerEndpointKeysGet_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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task QnAMakerEndpointKeysGet_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.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -5373,6 +10532,7 @@ public partial class BotService await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -5380,13 +10540,13 @@ public partial class BotService case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.QnAMakerEndpointKeysResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.QnAMakerEndpointKeysResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -5411,7 +10571,7 @@ public partial class BotService /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task QnAMakerEndpointKeysGet_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysRequestBody body, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task QnAMakerEndpointKeysGet_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysRequestBody body, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/AlexaChannel.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/AlexaChannel.PowerShell.cs similarity index 60% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/AlexaChannel.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/AlexaChannel.PowerShell.cs index ae993e845851..a111049d97c6 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/AlexaChannel.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/AlexaChannel.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,7 +55,15 @@ public partial class AlexaChannel 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,45 +78,45 @@ internal AlexaChannel(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannelProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.AlexaChannelPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.AlexaChannelPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Etag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Etag, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Etag, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).ProvisioningState, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("AlexaSkillId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannelInternal)this).AlexaSkillId = (string) content.GetValueForProperty("AlexaSkillId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannelInternal)this).AlexaSkillId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelInternal)this).AlexaSkillId = (string) content.GetValueForProperty("AlexaSkillId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelInternal)this).AlexaSkillId, global::System.Convert.ToString); } if (content.Contains("UrlFragment")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannelInternal)this).UrlFragment = (string) content.GetValueForProperty("UrlFragment",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannelInternal)this).UrlFragment, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelInternal)this).UrlFragment = (string) content.GetValueForProperty("UrlFragment",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelInternal)this).UrlFragment, global::System.Convert.ToString); } if (content.Contains("ServiceEndpointUri")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannelInternal)this).ServiceEndpointUri = (string) content.GetValueForProperty("ServiceEndpointUri",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannelInternal)this).ServiceEndpointUri, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelInternal)this).ServiceEndpointUri = (string) content.GetValueForProperty("ServiceEndpointUri",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelInternal)this).ServiceEndpointUri, global::System.Convert.ToString); } if (content.Contains("IsEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannelInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannelInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelInternal)this).IsEnabled = (bool?) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelInternal)this).IsEnabled, (__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. @@ -123,65 +131,65 @@ internal AlexaChannel(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannelProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.AlexaChannelPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.AlexaChannelPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Etag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Etag, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Etag, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).ProvisioningState, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("AlexaSkillId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannelInternal)this).AlexaSkillId = (string) content.GetValueForProperty("AlexaSkillId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannelInternal)this).AlexaSkillId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelInternal)this).AlexaSkillId = (string) content.GetValueForProperty("AlexaSkillId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelInternal)this).AlexaSkillId, global::System.Convert.ToString); } if (content.Contains("UrlFragment")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannelInternal)this).UrlFragment = (string) content.GetValueForProperty("UrlFragment",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannelInternal)this).UrlFragment, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelInternal)this).UrlFragment = (string) content.GetValueForProperty("UrlFragment",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelInternal)this).UrlFragment, global::System.Convert.ToString); } if (content.Contains("ServiceEndpointUri")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannelInternal)this).ServiceEndpointUri = (string) content.GetValueForProperty("ServiceEndpointUri",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannelInternal)this).ServiceEndpointUri, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelInternal)this).ServiceEndpointUri = (string) content.GetValueForProperty("ServiceEndpointUri",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelInternal)this).ServiceEndpointUri, global::System.Convert.ToString); } if (content.Contains("IsEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannelInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannelInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelInternal)this).IsEnabled = (bool?) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelInternal)this).IsEnabled, (__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.BotService.Models.Api20220615Preview.IAlexaChannel DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannel DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AlexaChannel(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.BotService.Models.Api20220615Preview.IAlexaChannel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AlexaChannel(content); } @@ -191,12 +199,24 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Pr /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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(); + } } /// Alexa channel definition [System.ComponentModel.TypeConverter(typeof(AlexaChannelTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/AlexaChannel.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/AlexaChannel.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/AlexaChannel.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/AlexaChannel.TypeConverter.cs index a43c6764a466..6bb9a4cc6895 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/AlexaChannel.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/AlexaChannel.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IAlexaChannel ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannel ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannel).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannel).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/AlexaChannel.cs b/generated/BotService/BotService.Autorest/generated/api/Models/AlexaChannel.cs similarity index 63% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/AlexaChannel.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/AlexaChannel.cs index 37237a1c6974..ed7dbab40f24 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/AlexaChannel.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/AlexaChannel.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// Alexa channel definition public partial class AlexaChannel : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannel, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannelInternal, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannel, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelInternal, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannel __channel = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Channel(); + private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannel __channel = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Channel(); /// The Alexa skill Id [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string AlexaSkillId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannelPropertiesInternal)Property).AlexaSkillId; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannelPropertiesInternal)Property).AlexaSkillId = value ?? null; } + public string AlexaSkillId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelPropertiesInternal)Property).AlexaSkillId; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelPropertiesInternal)Property).AlexaSkillId = value ?? null; } /// Entity Tag of the resource [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Etag = value ?? null; } + public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Etag = value ?? null; } /// Whether this channel is enabled for the bot [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public bool? IsEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannelPropertiesInternal)Property).IsEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannelPropertiesInternal)Property).IsEnabled = value ?? default(bool); } + public bool? IsEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelPropertiesInternal)Property).IsEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelPropertiesInternal)Property).IsEnabled = value ?? default(bool); } /// Specifies the location of the resource. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Location = value ?? null; } + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Location = value ?? null; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannelProperties Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannelInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.AlexaChannelProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelProperties Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.AlexaChannelProperties()); set { {_property = value;} } } /// Internal Acessors for ServiceEndpointUri - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannelInternal.ServiceEndpointUri { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannelPropertiesInternal)Property).ServiceEndpointUri; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannelPropertiesInternal)Property).ServiceEndpointUri = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelInternal.ServiceEndpointUri { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelPropertiesInternal)Property).ServiceEndpointUri; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelPropertiesInternal)Property).ServiceEndpointUri = value; } /// Internal Acessors for UrlFragment - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannelInternal.UrlFragment { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannelPropertiesInternal)Property).UrlFragment; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannelPropertiesInternal)Property).UrlFragment = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelInternal.UrlFragment { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelPropertiesInternal)Property).UrlFragment; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelPropertiesInternal)Property).UrlFragment = value; } /// Internal Acessors for ProvisioningState - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).ProvisioningState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).ProvisioningState = value; } /// The channel name + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Constant] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Name = value ; } + public string Name { get => "AlexaChannel"; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Name = "AlexaChannel"; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannelProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelProperties _property; /// The set of properties specific to Alexa channel resource [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannelProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.AlexaChannelProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.AlexaChannelProperties()); set => this._property = value; } /// Provisioning state of the resource [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).ProvisioningState; } + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).ProvisioningState; } /// Full Uri used to configured the skill in Alexa [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string ServiceEndpointUri { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannelPropertiesInternal)Property).ServiceEndpointUri; } + public string ServiceEndpointUri { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelPropertiesInternal)Property).ServiceEndpointUri; } /// Url fragment used in part of the Uri configured in Alexa [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string UrlFragment { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannelPropertiesInternal)Property).UrlFragment; } + public string UrlFragment { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelPropertiesInternal)Property).UrlFragment; } /// Creates an new instance. public AlexaChannel() { - + this.__channel.Name = "AlexaChannel"; } /// Validates that this object meets the validation criteria. @@ -91,12 +91,15 @@ public AlexaChannel() /// Alexa channel definition public partial interface IAlexaChannel : Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannel + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannel { /// The Alexa skill Id [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The Alexa skill Id", SerializedName = @"alexaSkillId", PossibleTypes = new [] { typeof(string) })] @@ -105,6 +108,9 @@ public partial interface IAlexaChannel : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Whether this channel is enabled for the bot", SerializedName = @"isEnabled", PossibleTypes = new [] { typeof(bool) })] @@ -113,6 +119,9 @@ public partial interface IAlexaChannel : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Full Uri used to configured the skill in Alexa", SerializedName = @"serviceEndpointUri", PossibleTypes = new [] { typeof(string) })] @@ -121,6 +130,9 @@ public partial interface IAlexaChannel : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Url fragment used in part of the Uri configured in Alexa", SerializedName = @"urlFragment", PossibleTypes = new [] { typeof(string) })] @@ -129,14 +141,14 @@ public partial interface IAlexaChannel : } /// Alexa channel definition internal partial interface IAlexaChannelInternal : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal { /// The Alexa skill Id string AlexaSkillId { get; set; } /// Whether this channel is enabled for the bot bool? IsEnabled { get; set; } /// The set of properties specific to Alexa channel resource - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannelProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelProperties Property { get; set; } /// Full Uri used to configured the skill in Alexa string ServiceEndpointUri { get; set; } /// Url fragment used in part of the Uri configured in Alexa diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/AlexaChannel.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/AlexaChannel.json.cs similarity index 93% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/AlexaChannel.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/AlexaChannel.json.cs index fcfb6516a0f0..fd8b0b4e490c 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/AlexaChannel.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/AlexaChannel.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -65,19 +65,19 @@ internal AlexaChannel(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json { return; } - __channel = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Channel(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.AlexaChannelProperties.FromJson(__jsonProperties) : Property;} + __channel = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Channel(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.AlexaChannelProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannel. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannel. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannel. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannel. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannel FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannel FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new AlexaChannel(json) : null; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/AlexaChannelProperties.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/AlexaChannelProperties.PowerShell.cs similarity index 67% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/AlexaChannelProperties.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/AlexaChannelProperties.PowerShell.cs index a4370f17fbb5..9f3c7c1bf252 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/AlexaChannelProperties.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/AlexaChannelProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,7 +55,15 @@ public partial class AlexaChannelProperties 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,25 +78,25 @@ internal AlexaChannelProperties(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("AlexaSkillId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannelPropertiesInternal)this).AlexaSkillId = (string) content.GetValueForProperty("AlexaSkillId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannelPropertiesInternal)this).AlexaSkillId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelPropertiesInternal)this).AlexaSkillId = (string) content.GetValueForProperty("AlexaSkillId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelPropertiesInternal)this).AlexaSkillId, global::System.Convert.ToString); } if (content.Contains("UrlFragment")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannelPropertiesInternal)this).UrlFragment = (string) content.GetValueForProperty("UrlFragment",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannelPropertiesInternal)this).UrlFragment, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelPropertiesInternal)this).UrlFragment = (string) content.GetValueForProperty("UrlFragment",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelPropertiesInternal)this).UrlFragment, global::System.Convert.ToString); } if (content.Contains("ServiceEndpointUri")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannelPropertiesInternal)this).ServiceEndpointUri = (string) content.GetValueForProperty("ServiceEndpointUri",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannelPropertiesInternal)this).ServiceEndpointUri, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelPropertiesInternal)this).ServiceEndpointUri = (string) content.GetValueForProperty("ServiceEndpointUri",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelPropertiesInternal)this).ServiceEndpointUri, global::System.Convert.ToString); } if (content.Contains("IsEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannelPropertiesInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannelPropertiesInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelPropertiesInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelPropertiesInternal)this).IsEnabled, (__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. @@ -103,47 +111,45 @@ internal AlexaChannelProperties(global::System.Management.Automation.PSObject co // actually deserialize if (content.Contains("AlexaSkillId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannelPropertiesInternal)this).AlexaSkillId = (string) content.GetValueForProperty("AlexaSkillId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannelPropertiesInternal)this).AlexaSkillId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelPropertiesInternal)this).AlexaSkillId = (string) content.GetValueForProperty("AlexaSkillId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelPropertiesInternal)this).AlexaSkillId, global::System.Convert.ToString); } if (content.Contains("UrlFragment")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannelPropertiesInternal)this).UrlFragment = (string) content.GetValueForProperty("UrlFragment",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannelPropertiesInternal)this).UrlFragment, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelPropertiesInternal)this).UrlFragment = (string) content.GetValueForProperty("UrlFragment",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelPropertiesInternal)this).UrlFragment, global::System.Convert.ToString); } if (content.Contains("ServiceEndpointUri")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannelPropertiesInternal)this).ServiceEndpointUri = (string) content.GetValueForProperty("ServiceEndpointUri",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannelPropertiesInternal)this).ServiceEndpointUri, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelPropertiesInternal)this).ServiceEndpointUri = (string) content.GetValueForProperty("ServiceEndpointUri",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelPropertiesInternal)this).ServiceEndpointUri, global::System.Convert.ToString); } if (content.Contains("IsEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannelPropertiesInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannelPropertiesInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelPropertiesInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelPropertiesInternal)this).IsEnabled, (__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.BotService.Models.Api20220615Preview.IAlexaChannelProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AlexaChannelProperties(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.BotService.Models.Api20220615Preview.IAlexaChannelProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AlexaChannelProperties(content); } @@ -153,12 +159,24 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Pr /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannelProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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 parameters to provide for the Alexa channel. [System.ComponentModel.TypeConverter(typeof(AlexaChannelPropertiesTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/AlexaChannelProperties.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/AlexaChannelProperties.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/AlexaChannelProperties.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/AlexaChannelProperties.TypeConverter.cs index a170c13f583f..ed14eaf8e78f 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/AlexaChannelProperties.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/AlexaChannelProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IAlexaChannelProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannelProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/AlexaChannelProperties.cs b/generated/BotService/BotService.Autorest/generated/api/Models/AlexaChannelProperties.cs similarity index 86% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/AlexaChannelProperties.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/AlexaChannelProperties.cs index 3fb180ef161c..e19f0cb18602 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/AlexaChannelProperties.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/AlexaChannelProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// The parameters to provide for the Alexa channel. public partial class AlexaChannelProperties : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannelProperties, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannelPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelProperties, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelPropertiesInternal { /// Backing field for property. @@ -28,10 +28,10 @@ public partial class AlexaChannelProperties : public bool IsEnabled { get => this._isEnabled; set => this._isEnabled = value; } /// Internal Acessors for ServiceEndpointUri - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannelPropertiesInternal.ServiceEndpointUri { get => this._serviceEndpointUri; set { {_serviceEndpointUri = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelPropertiesInternal.ServiceEndpointUri { get => this._serviceEndpointUri; set { {_serviceEndpointUri = value;} } } /// Internal Acessors for UrlFragment - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannelPropertiesInternal.UrlFragment { get => this._urlFragment; set { {_urlFragment = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelPropertiesInternal.UrlFragment { get => this._urlFragment; set { {_urlFragment = value;} } } /// Backing field for property. private string _serviceEndpointUri; @@ -61,6 +61,9 @@ public partial interface IAlexaChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The Alexa skill Id", SerializedName = @"alexaSkillId", PossibleTypes = new [] { typeof(string) })] @@ -69,6 +72,9 @@ public partial interface IAlexaChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Whether this channel is enabled for the bot", SerializedName = @"isEnabled", PossibleTypes = new [] { typeof(bool) })] @@ -77,6 +83,9 @@ public partial interface IAlexaChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Full Uri used to configured the skill in Alexa", SerializedName = @"serviceEndpointUri", PossibleTypes = new [] { typeof(string) })] @@ -85,6 +94,9 @@ public partial interface IAlexaChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Url fragment used in part of the Uri configured in Alexa", SerializedName = @"urlFragment", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/AlexaChannelProperties.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/AlexaChannelProperties.json.cs similarity index 92% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/AlexaChannelProperties.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/AlexaChannelProperties.json.cs index 393a4069b49a..dc3aeaa4a824 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/AlexaChannelProperties.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/AlexaChannelProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -65,21 +65,21 @@ internal AlexaChannelProperties(Microsoft.Azure.PowerShell.Cmdlets.BotService.Ru { return; } - {_alexaSkillId = If( json?.PropertyT("alexaSkillId"), out var __jsonAlexaSkillId) ? (string)__jsonAlexaSkillId : (string)AlexaSkillId;} - {_urlFragment = If( json?.PropertyT("urlFragment"), out var __jsonUrlFragment) ? (string)__jsonUrlFragment : (string)UrlFragment;} - {_serviceEndpointUri = If( json?.PropertyT("serviceEndpointUri"), out var __jsonServiceEndpointUri) ? (string)__jsonServiceEndpointUri : (string)ServiceEndpointUri;} - {_isEnabled = If( json?.PropertyT("isEnabled"), out var __jsonIsEnabled) ? (bool)__jsonIsEnabled : IsEnabled;} + {_alexaSkillId = If( json?.PropertyT("alexaSkillId"), out var __jsonAlexaSkillId) ? (string)__jsonAlexaSkillId : (string)_alexaSkillId;} + {_urlFragment = If( json?.PropertyT("urlFragment"), out var __jsonUrlFragment) ? (string)__jsonUrlFragment : (string)_urlFragment;} + {_serviceEndpointUri = If( json?.PropertyT("serviceEndpointUri"), out var __jsonServiceEndpointUri) ? (string)__jsonServiceEndpointUri : (string)_serviceEndpointUri;} + {_isEnabled = If( json?.PropertyT("isEnabled"), out var __jsonIsEnabled) ? (bool)__jsonIsEnabled : _isEnabled;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannelProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannelProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IAlexaChannelProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAlexaChannelProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new AlexaChannelProperties(json) : null; } @@ -104,11 +104,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode ToJso return container; } AddIf( null != (((object)this._alexaSkillId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._alexaSkillId.ToString()) : null, "alexaSkillId" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._urlFragment)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._urlFragment.ToString()) : null, "urlFragment" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._serviceEndpointUri)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._serviceEndpointUri.ToString()) : null, "serviceEndpointUri" ,container.Add ); } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Any.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/Any.PowerShell.cs index d73be0d3fa26..6fa6c641d5c8 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Any.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/Any.PowerShell.cs @@ -7,7 +7,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; - /// Any object + /// Anything [System.ComponentModel.TypeConverter(typeof(AnyTypeConverter))] public partial class Any { @@ -54,6 +54,14 @@ public partial class Any 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 . @@ -125,8 +133,20 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAny Deserial /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.BotService.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(); + } } - /// Any object + /// Anything [System.ComponentModel.TypeConverter(typeof(AnyTypeConverter))] public partial interface IAny diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Any.cs b/generated/BotService/BotService.Autorest/generated/api/Models/Any.cs index f18f3789a342..3b0714f06af9 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Any.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/Any.cs @@ -7,7 +7,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; - /// Any object + /// Anything public partial class Any : Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAny, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAnyInternal @@ -19,13 +19,13 @@ public Any() } } - /// Any object + /// Anything public partial interface IAny : Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IJsonSerializable { } - /// Any object + /// Anything internal partial interface IAnyInternal { diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Any.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/Any.json.cs index 95fc9d4a5dae..57bd5d642d4b 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Any.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/Any.json.cs @@ -7,7 +7,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; - /// Any object + /// Anything public partial class Any { diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Bot.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Bot.PowerShell.cs deleted file mode 100644 index 3a26d2b82544..000000000000 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Bot.PowerShell.cs +++ /dev/null @@ -1,512 +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.BotService.Models.Api20220615Preview -{ - using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; - - /// Bot resource definition - [System.ComponentModel.TypeConverter(typeof(BotTypeConverter))] - public partial class Bot - { - - /// - /// 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 a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal Bot(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.BotService.Models.Api20220615Preview.IBotInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.BotPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("SkuName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).SkuName = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).SkuName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName.CreateFrom); - } - if (content.Contains("SkuTier")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).SkuTier = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuTier?) content.GetValueForProperty("SkuTier",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).SkuTier, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuTier.CreateFrom); - } - if (content.Contains("Sku")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SkuTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Kind")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Kind?) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Kind.CreateFrom); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Etag, global::System.Convert.ToString); - } - if (content.Contains("Zone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Zone = (string[]) content.GetValueForProperty("Zone",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Zone, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("DisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).DisplayName, global::System.Convert.ToString); - } - if (content.Contains("Description")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).Description, global::System.Convert.ToString); - } - if (content.Contains("IconUrl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).IconUrl = (string) content.GetValueForProperty("IconUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).IconUrl, global::System.Convert.ToString); - } - if (content.Contains("Endpoint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).Endpoint = (string) content.GetValueForProperty("Endpoint",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).Endpoint, global::System.Convert.ToString); - } - if (content.Contains("EndpointVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).EndpointVersion = (string) content.GetValueForProperty("EndpointVersion",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).EndpointVersion, global::System.Convert.ToString); - } - if (content.Contains("AllSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).AllSetting = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesAllSettings) content.GetValueForProperty("AllSetting",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).AllSetting, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.BotPropertiesAllSettingsTypeConverter.ConvertFrom); - } - if (content.Contains("Parameter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).Parameter = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesParameters) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).Parameter, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.BotPropertiesParametersTypeConverter.ConvertFrom); - } - if (content.Contains("ManifestUrl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).ManifestUrl = (string) content.GetValueForProperty("ManifestUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).ManifestUrl, global::System.Convert.ToString); - } - if (content.Contains("MsaAppType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).MsaAppType = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.MsaAppType?) content.GetValueForProperty("MsaAppType",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).MsaAppType, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.MsaAppType.CreateFrom); - } - if (content.Contains("MsaAppId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).MsaAppId = (string) content.GetValueForProperty("MsaAppId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).MsaAppId, global::System.Convert.ToString); - } - if (content.Contains("MsaAppTenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).MsaAppTenantId = (string) content.GetValueForProperty("MsaAppTenantId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).MsaAppTenantId, global::System.Convert.ToString); - } - if (content.Contains("MsaAppMsiResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).MsaAppMsiResourceId = (string) content.GetValueForProperty("MsaAppMsiResourceId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).MsaAppMsiResourceId, global::System.Convert.ToString); - } - if (content.Contains("ConfiguredChannel")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).ConfiguredChannel = (string[]) content.GetValueForProperty("ConfiguredChannel",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).ConfiguredChannel, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("EnabledChannel")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).EnabledChannel = (string[]) content.GetValueForProperty("EnabledChannel",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).EnabledChannel, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("DeveloperAppInsightKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).DeveloperAppInsightKey = (string) content.GetValueForProperty("DeveloperAppInsightKey",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).DeveloperAppInsightKey, global::System.Convert.ToString); - } - if (content.Contains("DeveloperAppInsightsApiKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).DeveloperAppInsightsApiKey = (string) content.GetValueForProperty("DeveloperAppInsightsApiKey",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).DeveloperAppInsightsApiKey, global::System.Convert.ToString); - } - if (content.Contains("DeveloperAppInsightsApplicationId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).DeveloperAppInsightsApplicationId = (string) content.GetValueForProperty("DeveloperAppInsightsApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).DeveloperAppInsightsApplicationId, global::System.Convert.ToString); - } - if (content.Contains("LuisAppId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).LuisAppId = (string[]) content.GetValueForProperty("LuisAppId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).LuisAppId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("LuisKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).LuisKey = (string) content.GetValueForProperty("LuisKey",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).LuisKey, global::System.Convert.ToString); - } - if (content.Contains("IsCmekEnabled")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).IsCmekEnabled = (bool?) content.GetValueForProperty("IsCmekEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).IsCmekEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("CmekKeyVaultUrl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).CmekKeyVaultUrl = (string) content.GetValueForProperty("CmekKeyVaultUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).CmekKeyVaultUrl, global::System.Convert.ToString); - } - if (content.Contains("CmekEncryptionStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).CmekEncryptionStatus = (string) content.GetValueForProperty("CmekEncryptionStatus",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).CmekEncryptionStatus, global::System.Convert.ToString); - } - if (content.Contains("TenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).TenantId, global::System.Convert.ToString); - } - if (content.Contains("PublicNetworkAccess")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PublicNetworkAccess.CreateFrom); - } - if (content.Contains("IsStreamingSupported")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).IsStreamingSupported = (bool?) content.GetValueForProperty("IsStreamingSupported",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).IsStreamingSupported, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("IsDeveloperAppInsightsApiKeySet")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).IsDeveloperAppInsightsApiKeySet = (bool?) content.GetValueForProperty("IsDeveloperAppInsightsApiKeySet",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).IsDeveloperAppInsightsApiKeySet, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("MigrationToken")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).MigrationToken = (string) content.GetValueForProperty("MigrationToken",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).MigrationToken, global::System.Convert.ToString); - } - if (content.Contains("DisableLocalAuth")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).DisableLocalAuth = (bool?) content.GetValueForProperty("DisableLocalAuth",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).DisableLocalAuth, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("SchemaTransformationVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).SchemaTransformationVersion = (string) content.GetValueForProperty("SchemaTransformationVersion",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).SchemaTransformationVersion, global::System.Convert.ToString); - } - if (content.Contains("StorageResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).StorageResourceId = (string) content.GetValueForProperty("StorageResourceId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).StorageResourceId, global::System.Convert.ToString); - } - if (content.Contains("PrivateEndpointConnection")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).PrivateEndpointConnection = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnection[]) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateEndpointConnectionTypeConverter.ConvertFrom)); - } - if (content.Contains("OpenWithHint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).OpenWithHint = (string) content.GetValueForProperty("OpenWithHint",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).OpenWithHint, global::System.Convert.ToString); - } - if (content.Contains("AppPasswordHint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).AppPasswordHint = (string) content.GetValueForProperty("AppPasswordHint",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).AppPasswordHint, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).ProvisioningState, global::System.Convert.ToString); - } - if (content.Contains("PublishingCredentials")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).PublishingCredentials = (string) content.GetValueForProperty("PublishingCredentials",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).PublishingCredentials, 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 Bot(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.BotService.Models.Api20220615Preview.IBotInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.BotPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("SkuName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).SkuName = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).SkuName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName.CreateFrom); - } - if (content.Contains("SkuTier")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).SkuTier = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuTier?) content.GetValueForProperty("SkuTier",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).SkuTier, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuTier.CreateFrom); - } - if (content.Contains("Sku")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SkuTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Kind")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Kind?) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Kind.CreateFrom); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Etag, global::System.Convert.ToString); - } - if (content.Contains("Zone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Zone = (string[]) content.GetValueForProperty("Zone",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Zone, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("DisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).DisplayName, global::System.Convert.ToString); - } - if (content.Contains("Description")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).Description, global::System.Convert.ToString); - } - if (content.Contains("IconUrl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).IconUrl = (string) content.GetValueForProperty("IconUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).IconUrl, global::System.Convert.ToString); - } - if (content.Contains("Endpoint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).Endpoint = (string) content.GetValueForProperty("Endpoint",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).Endpoint, global::System.Convert.ToString); - } - if (content.Contains("EndpointVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).EndpointVersion = (string) content.GetValueForProperty("EndpointVersion",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).EndpointVersion, global::System.Convert.ToString); - } - if (content.Contains("AllSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).AllSetting = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesAllSettings) content.GetValueForProperty("AllSetting",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).AllSetting, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.BotPropertiesAllSettingsTypeConverter.ConvertFrom); - } - if (content.Contains("Parameter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).Parameter = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesParameters) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).Parameter, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.BotPropertiesParametersTypeConverter.ConvertFrom); - } - if (content.Contains("ManifestUrl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).ManifestUrl = (string) content.GetValueForProperty("ManifestUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).ManifestUrl, global::System.Convert.ToString); - } - if (content.Contains("MsaAppType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).MsaAppType = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.MsaAppType?) content.GetValueForProperty("MsaAppType",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).MsaAppType, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.MsaAppType.CreateFrom); - } - if (content.Contains("MsaAppId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).MsaAppId = (string) content.GetValueForProperty("MsaAppId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).MsaAppId, global::System.Convert.ToString); - } - if (content.Contains("MsaAppTenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).MsaAppTenantId = (string) content.GetValueForProperty("MsaAppTenantId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).MsaAppTenantId, global::System.Convert.ToString); - } - if (content.Contains("MsaAppMsiResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).MsaAppMsiResourceId = (string) content.GetValueForProperty("MsaAppMsiResourceId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).MsaAppMsiResourceId, global::System.Convert.ToString); - } - if (content.Contains("ConfiguredChannel")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).ConfiguredChannel = (string[]) content.GetValueForProperty("ConfiguredChannel",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).ConfiguredChannel, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("EnabledChannel")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).EnabledChannel = (string[]) content.GetValueForProperty("EnabledChannel",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).EnabledChannel, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("DeveloperAppInsightKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).DeveloperAppInsightKey = (string) content.GetValueForProperty("DeveloperAppInsightKey",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).DeveloperAppInsightKey, global::System.Convert.ToString); - } - if (content.Contains("DeveloperAppInsightsApiKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).DeveloperAppInsightsApiKey = (string) content.GetValueForProperty("DeveloperAppInsightsApiKey",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).DeveloperAppInsightsApiKey, global::System.Convert.ToString); - } - if (content.Contains("DeveloperAppInsightsApplicationId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).DeveloperAppInsightsApplicationId = (string) content.GetValueForProperty("DeveloperAppInsightsApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).DeveloperAppInsightsApplicationId, global::System.Convert.ToString); - } - if (content.Contains("LuisAppId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).LuisAppId = (string[]) content.GetValueForProperty("LuisAppId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).LuisAppId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("LuisKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).LuisKey = (string) content.GetValueForProperty("LuisKey",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).LuisKey, global::System.Convert.ToString); - } - if (content.Contains("IsCmekEnabled")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).IsCmekEnabled = (bool?) content.GetValueForProperty("IsCmekEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).IsCmekEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("CmekKeyVaultUrl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).CmekKeyVaultUrl = (string) content.GetValueForProperty("CmekKeyVaultUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).CmekKeyVaultUrl, global::System.Convert.ToString); - } - if (content.Contains("CmekEncryptionStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).CmekEncryptionStatus = (string) content.GetValueForProperty("CmekEncryptionStatus",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).CmekEncryptionStatus, global::System.Convert.ToString); - } - if (content.Contains("TenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).TenantId, global::System.Convert.ToString); - } - if (content.Contains("PublicNetworkAccess")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PublicNetworkAccess.CreateFrom); - } - if (content.Contains("IsStreamingSupported")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).IsStreamingSupported = (bool?) content.GetValueForProperty("IsStreamingSupported",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).IsStreamingSupported, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("IsDeveloperAppInsightsApiKeySet")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).IsDeveloperAppInsightsApiKeySet = (bool?) content.GetValueForProperty("IsDeveloperAppInsightsApiKeySet",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).IsDeveloperAppInsightsApiKeySet, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("MigrationToken")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).MigrationToken = (string) content.GetValueForProperty("MigrationToken",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).MigrationToken, global::System.Convert.ToString); - } - if (content.Contains("DisableLocalAuth")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).DisableLocalAuth = (bool?) content.GetValueForProperty("DisableLocalAuth",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).DisableLocalAuth, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("SchemaTransformationVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).SchemaTransformationVersion = (string) content.GetValueForProperty("SchemaTransformationVersion",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).SchemaTransformationVersion, global::System.Convert.ToString); - } - if (content.Contains("StorageResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).StorageResourceId = (string) content.GetValueForProperty("StorageResourceId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).StorageResourceId, global::System.Convert.ToString); - } - if (content.Contains("PrivateEndpointConnection")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).PrivateEndpointConnection = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnection[]) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateEndpointConnectionTypeConverter.ConvertFrom)); - } - if (content.Contains("OpenWithHint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).OpenWithHint = (string) content.GetValueForProperty("OpenWithHint",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).OpenWithHint, global::System.Convert.ToString); - } - if (content.Contains("AppPasswordHint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).AppPasswordHint = (string) content.GetValueForProperty("AppPasswordHint",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).AppPasswordHint, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).ProvisioningState, global::System.Convert.ToString); - } - if (content.Contains("PublishingCredentials")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).PublishingCredentials = (string) content.GetValueForProperty("PublishingCredentials",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal)this).PublishingCredentials, global::System.Convert.ToString); - } - AfterDeserializePSObject(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new Bot(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.BotService.Models.Api20220615Preview.IBot DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new Bot(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.BotService.Models.Api20220615Preview.IBot FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// Bot resource definition - [System.ComponentModel.TypeConverter(typeof(BotTypeConverter))] - public partial interface IBot - - { - - } -} \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotProperties.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotProperties.PowerShell.cs deleted file mode 100644 index f62367ee5bcc..000000000000 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotProperties.PowerShell.cs +++ /dev/null @@ -1,416 +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.BotService.Models.Api20220615Preview -{ - using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; - - /// The parameters to provide for the Bot. - [System.ComponentModel.TypeConverter(typeof(BotPropertiesTypeConverter))] - public partial class BotProperties - { - - /// - /// 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 a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal BotProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("DisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).DisplayName, global::System.Convert.ToString); - } - if (content.Contains("Description")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).Description, global::System.Convert.ToString); - } - if (content.Contains("IconUrl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).IconUrl = (string) content.GetValueForProperty("IconUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).IconUrl, global::System.Convert.ToString); - } - if (content.Contains("Endpoint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).Endpoint = (string) content.GetValueForProperty("Endpoint",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).Endpoint, global::System.Convert.ToString); - } - if (content.Contains("EndpointVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).EndpointVersion = (string) content.GetValueForProperty("EndpointVersion",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).EndpointVersion, global::System.Convert.ToString); - } - if (content.Contains("AllSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).AllSetting = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesAllSettings) content.GetValueForProperty("AllSetting",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).AllSetting, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.BotPropertiesAllSettingsTypeConverter.ConvertFrom); - } - if (content.Contains("Parameter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).Parameter = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesParameters) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).Parameter, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.BotPropertiesParametersTypeConverter.ConvertFrom); - } - if (content.Contains("ManifestUrl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).ManifestUrl = (string) content.GetValueForProperty("ManifestUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).ManifestUrl, global::System.Convert.ToString); - } - if (content.Contains("MsaAppType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).MsaAppType = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.MsaAppType?) content.GetValueForProperty("MsaAppType",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).MsaAppType, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.MsaAppType.CreateFrom); - } - if (content.Contains("MsaAppId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).MsaAppId = (string) content.GetValueForProperty("MsaAppId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).MsaAppId, global::System.Convert.ToString); - } - if (content.Contains("MsaAppTenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).MsaAppTenantId = (string) content.GetValueForProperty("MsaAppTenantId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).MsaAppTenantId, global::System.Convert.ToString); - } - if (content.Contains("MsaAppMsiResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).MsaAppMsiResourceId = (string) content.GetValueForProperty("MsaAppMsiResourceId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).MsaAppMsiResourceId, global::System.Convert.ToString); - } - if (content.Contains("ConfiguredChannel")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).ConfiguredChannel = (string[]) content.GetValueForProperty("ConfiguredChannel",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).ConfiguredChannel, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("EnabledChannel")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).EnabledChannel = (string[]) content.GetValueForProperty("EnabledChannel",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).EnabledChannel, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("DeveloperAppInsightKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).DeveloperAppInsightKey = (string) content.GetValueForProperty("DeveloperAppInsightKey",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).DeveloperAppInsightKey, global::System.Convert.ToString); - } - if (content.Contains("DeveloperAppInsightsApiKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).DeveloperAppInsightsApiKey = (string) content.GetValueForProperty("DeveloperAppInsightsApiKey",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).DeveloperAppInsightsApiKey, global::System.Convert.ToString); - } - if (content.Contains("DeveloperAppInsightsApplicationId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).DeveloperAppInsightsApplicationId = (string) content.GetValueForProperty("DeveloperAppInsightsApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).DeveloperAppInsightsApplicationId, global::System.Convert.ToString); - } - if (content.Contains("LuisAppId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).LuisAppId = (string[]) content.GetValueForProperty("LuisAppId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).LuisAppId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("LuisKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).LuisKey = (string) content.GetValueForProperty("LuisKey",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).LuisKey, global::System.Convert.ToString); - } - if (content.Contains("IsCmekEnabled")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).IsCmekEnabled = (bool?) content.GetValueForProperty("IsCmekEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).IsCmekEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("CmekKeyVaultUrl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).CmekKeyVaultUrl = (string) content.GetValueForProperty("CmekKeyVaultUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).CmekKeyVaultUrl, global::System.Convert.ToString); - } - if (content.Contains("CmekEncryptionStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).CmekEncryptionStatus = (string) content.GetValueForProperty("CmekEncryptionStatus",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).CmekEncryptionStatus, global::System.Convert.ToString); - } - if (content.Contains("TenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).TenantId, global::System.Convert.ToString); - } - if (content.Contains("PublicNetworkAccess")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PublicNetworkAccess.CreateFrom); - } - if (content.Contains("IsStreamingSupported")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).IsStreamingSupported = (bool?) content.GetValueForProperty("IsStreamingSupported",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).IsStreamingSupported, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("IsDeveloperAppInsightsApiKeySet")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).IsDeveloperAppInsightsApiKeySet = (bool?) content.GetValueForProperty("IsDeveloperAppInsightsApiKeySet",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).IsDeveloperAppInsightsApiKeySet, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("MigrationToken")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).MigrationToken = (string) content.GetValueForProperty("MigrationToken",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).MigrationToken, global::System.Convert.ToString); - } - if (content.Contains("DisableLocalAuth")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).DisableLocalAuth = (bool?) content.GetValueForProperty("DisableLocalAuth",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).DisableLocalAuth, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("SchemaTransformationVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).SchemaTransformationVersion = (string) content.GetValueForProperty("SchemaTransformationVersion",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).SchemaTransformationVersion, global::System.Convert.ToString); - } - if (content.Contains("StorageResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).StorageResourceId = (string) content.GetValueForProperty("StorageResourceId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).StorageResourceId, global::System.Convert.ToString); - } - if (content.Contains("PrivateEndpointConnection")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).PrivateEndpointConnection = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnection[]) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateEndpointConnectionTypeConverter.ConvertFrom)); - } - if (content.Contains("OpenWithHint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).OpenWithHint = (string) content.GetValueForProperty("OpenWithHint",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).OpenWithHint, global::System.Convert.ToString); - } - if (content.Contains("AppPasswordHint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).AppPasswordHint = (string) content.GetValueForProperty("AppPasswordHint",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).AppPasswordHint, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); - } - if (content.Contains("PublishingCredentials")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).PublishingCredentials = (string) content.GetValueForProperty("PublishingCredentials",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).PublishingCredentials, 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 BotProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("DisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).DisplayName, global::System.Convert.ToString); - } - if (content.Contains("Description")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).Description, global::System.Convert.ToString); - } - if (content.Contains("IconUrl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).IconUrl = (string) content.GetValueForProperty("IconUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).IconUrl, global::System.Convert.ToString); - } - if (content.Contains("Endpoint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).Endpoint = (string) content.GetValueForProperty("Endpoint",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).Endpoint, global::System.Convert.ToString); - } - if (content.Contains("EndpointVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).EndpointVersion = (string) content.GetValueForProperty("EndpointVersion",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).EndpointVersion, global::System.Convert.ToString); - } - if (content.Contains("AllSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).AllSetting = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesAllSettings) content.GetValueForProperty("AllSetting",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).AllSetting, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.BotPropertiesAllSettingsTypeConverter.ConvertFrom); - } - if (content.Contains("Parameter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).Parameter = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesParameters) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).Parameter, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.BotPropertiesParametersTypeConverter.ConvertFrom); - } - if (content.Contains("ManifestUrl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).ManifestUrl = (string) content.GetValueForProperty("ManifestUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).ManifestUrl, global::System.Convert.ToString); - } - if (content.Contains("MsaAppType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).MsaAppType = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.MsaAppType?) content.GetValueForProperty("MsaAppType",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).MsaAppType, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.MsaAppType.CreateFrom); - } - if (content.Contains("MsaAppId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).MsaAppId = (string) content.GetValueForProperty("MsaAppId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).MsaAppId, global::System.Convert.ToString); - } - if (content.Contains("MsaAppTenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).MsaAppTenantId = (string) content.GetValueForProperty("MsaAppTenantId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).MsaAppTenantId, global::System.Convert.ToString); - } - if (content.Contains("MsaAppMsiResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).MsaAppMsiResourceId = (string) content.GetValueForProperty("MsaAppMsiResourceId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).MsaAppMsiResourceId, global::System.Convert.ToString); - } - if (content.Contains("ConfiguredChannel")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).ConfiguredChannel = (string[]) content.GetValueForProperty("ConfiguredChannel",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).ConfiguredChannel, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("EnabledChannel")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).EnabledChannel = (string[]) content.GetValueForProperty("EnabledChannel",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).EnabledChannel, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("DeveloperAppInsightKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).DeveloperAppInsightKey = (string) content.GetValueForProperty("DeveloperAppInsightKey",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).DeveloperAppInsightKey, global::System.Convert.ToString); - } - if (content.Contains("DeveloperAppInsightsApiKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).DeveloperAppInsightsApiKey = (string) content.GetValueForProperty("DeveloperAppInsightsApiKey",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).DeveloperAppInsightsApiKey, global::System.Convert.ToString); - } - if (content.Contains("DeveloperAppInsightsApplicationId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).DeveloperAppInsightsApplicationId = (string) content.GetValueForProperty("DeveloperAppInsightsApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).DeveloperAppInsightsApplicationId, global::System.Convert.ToString); - } - if (content.Contains("LuisAppId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).LuisAppId = (string[]) content.GetValueForProperty("LuisAppId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).LuisAppId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("LuisKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).LuisKey = (string) content.GetValueForProperty("LuisKey",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).LuisKey, global::System.Convert.ToString); - } - if (content.Contains("IsCmekEnabled")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).IsCmekEnabled = (bool?) content.GetValueForProperty("IsCmekEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).IsCmekEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("CmekKeyVaultUrl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).CmekKeyVaultUrl = (string) content.GetValueForProperty("CmekKeyVaultUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).CmekKeyVaultUrl, global::System.Convert.ToString); - } - if (content.Contains("CmekEncryptionStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).CmekEncryptionStatus = (string) content.GetValueForProperty("CmekEncryptionStatus",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).CmekEncryptionStatus, global::System.Convert.ToString); - } - if (content.Contains("TenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).TenantId, global::System.Convert.ToString); - } - if (content.Contains("PublicNetworkAccess")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PublicNetworkAccess.CreateFrom); - } - if (content.Contains("IsStreamingSupported")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).IsStreamingSupported = (bool?) content.GetValueForProperty("IsStreamingSupported",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).IsStreamingSupported, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("IsDeveloperAppInsightsApiKeySet")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).IsDeveloperAppInsightsApiKeySet = (bool?) content.GetValueForProperty("IsDeveloperAppInsightsApiKeySet",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).IsDeveloperAppInsightsApiKeySet, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("MigrationToken")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).MigrationToken = (string) content.GetValueForProperty("MigrationToken",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).MigrationToken, global::System.Convert.ToString); - } - if (content.Contains("DisableLocalAuth")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).DisableLocalAuth = (bool?) content.GetValueForProperty("DisableLocalAuth",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).DisableLocalAuth, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("SchemaTransformationVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).SchemaTransformationVersion = (string) content.GetValueForProperty("SchemaTransformationVersion",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).SchemaTransformationVersion, global::System.Convert.ToString); - } - if (content.Contains("StorageResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).StorageResourceId = (string) content.GetValueForProperty("StorageResourceId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).StorageResourceId, global::System.Convert.ToString); - } - if (content.Contains("PrivateEndpointConnection")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).PrivateEndpointConnection = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnection[]) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateEndpointConnectionTypeConverter.ConvertFrom)); - } - if (content.Contains("OpenWithHint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).OpenWithHint = (string) content.GetValueForProperty("OpenWithHint",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).OpenWithHint, global::System.Convert.ToString); - } - if (content.Contains("AppPasswordHint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).AppPasswordHint = (string) content.GetValueForProperty("AppPasswordHint",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).AppPasswordHint, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); - } - if (content.Contains("PublishingCredentials")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).PublishingCredentials = (string) content.GetValueForProperty("PublishingCredentials",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)this).PublishingCredentials, global::System.Convert.ToString); - } - AfterDeserializePSObject(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new BotProperties(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.BotService.Models.Api20220615Preview.IBotProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new BotProperties(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.BotService.Models.Api20220615Preview.IBotProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// The parameters to provide for the Bot. - [System.ComponentModel.TypeConverter(typeof(BotPropertiesTypeConverter))] - public partial interface IBotProperties - - { - - } -} \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ConnectionSetting.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ConnectionSetting.PowerShell.cs deleted file mode 100644 index ba793200aedd..000000000000 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ConnectionSetting.PowerShell.cs +++ /dev/null @@ -1,314 +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.BotService.Models.Api20220615Preview -{ - using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; - - /// Bot channel resource definition - [System.ComponentModel.TypeConverter(typeof(ConnectionSettingTypeConverter))] - public partial class ConnectionSetting - { - - /// - /// 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 a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal ConnectionSetting(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.BotService.Models.Api20220615Preview.IConnectionSettingInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ConnectionSettingPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("SkuName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).SkuName = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).SkuName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName.CreateFrom); - } - if (content.Contains("SkuTier")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).SkuTier = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuTier?) content.GetValueForProperty("SkuTier",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).SkuTier, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuTier.CreateFrom); - } - if (content.Contains("Sku")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SkuTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Kind")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Kind?) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Kind.CreateFrom); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Etag, global::System.Convert.ToString); - } - if (content.Contains("Zone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Zone = (string[]) content.GetValueForProperty("Zone",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Zone, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("PropertiesId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingInternal)this).PropertiesId = (string) content.GetValueForProperty("PropertiesId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingInternal)this).PropertiesId, global::System.Convert.ToString); - } - if (content.Contains("PropertiesName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingInternal)this).PropertiesName = (string) content.GetValueForProperty("PropertiesName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingInternal)this).PropertiesName, global::System.Convert.ToString); - } - if (content.Contains("ClientId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingInternal)this).ClientId = (string) content.GetValueForProperty("ClientId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingInternal)this).ClientId, global::System.Convert.ToString); - } - if (content.Contains("SettingId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingInternal)this).SettingId = (string) content.GetValueForProperty("SettingId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingInternal)this).SettingId, global::System.Convert.ToString); - } - if (content.Contains("ClientSecret")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingInternal)this).ClientSecret = (string) content.GetValueForProperty("ClientSecret",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingInternal)this).ClientSecret, global::System.Convert.ToString); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("ServiceProviderId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingInternal)this).ServiceProviderId = (string) content.GetValueForProperty("ServiceProviderId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingInternal)this).ServiceProviderId, global::System.Convert.ToString); - } - if (content.Contains("ServiceProviderDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingInternal)this).ServiceProviderDisplayName = (string) content.GetValueForProperty("ServiceProviderDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingInternal)this).ServiceProviderDisplayName, global::System.Convert.ToString); - } - if (content.Contains("Parameter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingInternal)this).Parameter = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingParameter[]) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingInternal)this).Parameter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ConnectionSettingParameterTypeConverter.ConvertFrom)); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingInternal)this).ProvisioningState, 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 ConnectionSetting(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.BotService.Models.Api20220615Preview.IConnectionSettingInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ConnectionSettingPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("SkuName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).SkuName = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).SkuName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName.CreateFrom); - } - if (content.Contains("SkuTier")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).SkuTier = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuTier?) content.GetValueForProperty("SkuTier",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).SkuTier, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuTier.CreateFrom); - } - if (content.Contains("Sku")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SkuTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Kind")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Kind?) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Kind.CreateFrom); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Etag, global::System.Convert.ToString); - } - if (content.Contains("Zone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Zone = (string[]) content.GetValueForProperty("Zone",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Zone, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("PropertiesId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingInternal)this).PropertiesId = (string) content.GetValueForProperty("PropertiesId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingInternal)this).PropertiesId, global::System.Convert.ToString); - } - if (content.Contains("PropertiesName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingInternal)this).PropertiesName = (string) content.GetValueForProperty("PropertiesName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingInternal)this).PropertiesName, global::System.Convert.ToString); - } - if (content.Contains("ClientId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingInternal)this).ClientId = (string) content.GetValueForProperty("ClientId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingInternal)this).ClientId, global::System.Convert.ToString); - } - if (content.Contains("SettingId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingInternal)this).SettingId = (string) content.GetValueForProperty("SettingId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingInternal)this).SettingId, global::System.Convert.ToString); - } - if (content.Contains("ClientSecret")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingInternal)this).ClientSecret = (string) content.GetValueForProperty("ClientSecret",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingInternal)this).ClientSecret, global::System.Convert.ToString); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("ServiceProviderId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingInternal)this).ServiceProviderId = (string) content.GetValueForProperty("ServiceProviderId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingInternal)this).ServiceProviderId, global::System.Convert.ToString); - } - if (content.Contains("ServiceProviderDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingInternal)this).ServiceProviderDisplayName = (string) content.GetValueForProperty("ServiceProviderDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingInternal)this).ServiceProviderDisplayName, global::System.Convert.ToString); - } - if (content.Contains("Parameter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingInternal)this).Parameter = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingParameter[]) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingInternal)this).Parameter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ConnectionSettingParameterTypeConverter.ConvertFrom)); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingInternal)this).ProvisioningState, global::System.Convert.ToString); - } - AfterDeserializePSObject(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSetting DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ConnectionSetting(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.BotService.Models.Api20220615Preview.IConnectionSetting DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ConnectionSetting(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.BotService.Models.Api20220615Preview.IConnectionSetting FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// Bot channel resource definition - [System.ComponentModel.TypeConverter(typeof(ConnectionSettingTypeConverter))] - public partial interface IConnectionSetting - - { - - } -} \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ListChannelWithKeysResponse.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ListChannelWithKeysResponse.PowerShell.cs deleted file mode 100644 index a5000ae2a431..000000000000 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ListChannelWithKeysResponse.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.BotService.Models.Api20220615Preview -{ - using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; - - /// The ARM channel of list channel with keys operation response. - [System.ComponentModel.TypeConverter(typeof(ListChannelWithKeysResponseTypeConverter))] - public partial class ListChannelWithKeysResponse - { - - /// - /// 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.BotService.Models.Api20220615Preview.IListChannelWithKeysResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ListChannelWithKeysResponse(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.BotService.Models.Api20220615Preview.IListChannelWithKeysResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ListChannelWithKeysResponse(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.BotService.Models.Api20220615Preview.IListChannelWithKeysResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal ListChannelWithKeysResponse(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Resource")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).Resource = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannel) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).Resource, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ChannelTypeConverter.ConvertFrom); - } - if (content.Contains("Setting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).Setting = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettings) content.GetValueForProperty("Setting",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).Setting, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ChannelSettingsTypeConverter.ConvertFrom); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).ProvisioningState, global::System.Convert.ToString); - } - if (content.Contains("EntityTag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).EntityTag = (string) content.GetValueForProperty("EntityTag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).EntityTag, global::System.Convert.ToString); - } - if (content.Contains("ChangedTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).ChangedTime = (string) content.GetValueForProperty("ChangedTime",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).ChangedTime, global::System.Convert.ToString); - } - if (content.Contains("SkuName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).SkuName = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).SkuName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName.CreateFrom); - } - if (content.Contains("SkuTier")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).SkuTier = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuTier?) content.GetValueForProperty("SkuTier",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).SkuTier, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuTier.CreateFrom); - } - if (content.Contains("Sku")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SkuTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Kind")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Kind?) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Kind.CreateFrom); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Etag, global::System.Convert.ToString); - } - if (content.Contains("Zone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Zone = (string[]) content.GetValueForProperty("Zone",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Zone, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("ChannelName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannelInternal)this).ChannelName = (string) content.GetValueForProperty("ChannelName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannelInternal)this).ChannelName, global::System.Convert.ToString); - } - if (content.Contains("PropertiesEtag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannelInternal)this).PropertiesEtag = (string) content.GetValueForProperty("PropertiesEtag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannelInternal)this).PropertiesEtag, global::System.Convert.ToString); - } - if (content.Contains("PropertiesProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannelInternal)this).PropertiesProvisioningState = (string) content.GetValueForProperty("PropertiesProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannelInternal)this).PropertiesProvisioningState, global::System.Convert.ToString); - } - if (content.Contains("PropertiesLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannelInternal)this).PropertiesLocation = (string) content.GetValueForProperty("PropertiesLocation",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannelInternal)this).PropertiesLocation, global::System.Convert.ToString); - } - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannel) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ChannelTypeConverter.ConvertFrom); - } - if (content.Contains("ResourceChannelName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).ResourceChannelName = (string) content.GetValueForProperty("ResourceChannelName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).ResourceChannelName, global::System.Convert.ToString); - } - if (content.Contains("ResourceEtag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).ResourceEtag = (string) content.GetValueForProperty("ResourceEtag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).ResourceEtag, global::System.Convert.ToString); - } - if (content.Contains("ResourceProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).ResourceProvisioningState = (string) content.GetValueForProperty("ResourceProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).ResourceProvisioningState, global::System.Convert.ToString); - } - if (content.Contains("ResourceLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).ResourceLocation = (string) content.GetValueForProperty("ResourceLocation",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).ResourceLocation, global::System.Convert.ToString); - } - if (content.Contains("SettingExtensionKey1")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).SettingExtensionKey1 = (string) content.GetValueForProperty("SettingExtensionKey1",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).SettingExtensionKey1, global::System.Convert.ToString); - } - if (content.Contains("SettingExtensionKey2")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).SettingExtensionKey2 = (string) content.GetValueForProperty("SettingExtensionKey2",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).SettingExtensionKey2, global::System.Convert.ToString); - } - if (content.Contains("SettingSite")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).SettingSite = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISite[]) content.GetValueForProperty("SettingSite",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).SettingSite, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SiteTypeConverter.ConvertFrom)); - } - if (content.Contains("SettingChannelId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).SettingChannelId = (string) content.GetValueForProperty("SettingChannelId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).SettingChannelId, global::System.Convert.ToString); - } - if (content.Contains("SettingChannelDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).SettingChannelDisplayName = (string) content.GetValueForProperty("SettingChannelDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).SettingChannelDisplayName, global::System.Convert.ToString); - } - if (content.Contains("SettingBotId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).SettingBotId = (string) content.GetValueForProperty("SettingBotId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).SettingBotId, global::System.Convert.ToString); - } - if (content.Contains("SettingBotIconUrl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).SettingBotIconUrl = (string) content.GetValueForProperty("SettingBotIconUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).SettingBotIconUrl, global::System.Convert.ToString); - } - if (content.Contains("SettingIsEnabled")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).SettingIsEnabled = (bool?) content.GetValueForProperty("SettingIsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).SettingIsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("SettingDisableLocalAuth")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).SettingDisableLocalAuth = (bool?) content.GetValueForProperty("SettingDisableLocalAuth",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).SettingDisableLocalAuth, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal ListChannelWithKeysResponse(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Resource")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).Resource = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannel) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).Resource, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ChannelTypeConverter.ConvertFrom); - } - if (content.Contains("Setting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).Setting = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettings) content.GetValueForProperty("Setting",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).Setting, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ChannelSettingsTypeConverter.ConvertFrom); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).ProvisioningState, global::System.Convert.ToString); - } - if (content.Contains("EntityTag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).EntityTag = (string) content.GetValueForProperty("EntityTag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).EntityTag, global::System.Convert.ToString); - } - if (content.Contains("ChangedTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).ChangedTime = (string) content.GetValueForProperty("ChangedTime",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).ChangedTime, global::System.Convert.ToString); - } - if (content.Contains("SkuName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).SkuName = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).SkuName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName.CreateFrom); - } - if (content.Contains("SkuTier")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).SkuTier = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuTier?) content.GetValueForProperty("SkuTier",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).SkuTier, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuTier.CreateFrom); - } - if (content.Contains("Sku")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SkuTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Kind")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Kind?) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Kind.CreateFrom); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Etag, global::System.Convert.ToString); - } - if (content.Contains("Zone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Zone = (string[]) content.GetValueForProperty("Zone",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Zone, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("ChannelName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannelInternal)this).ChannelName = (string) content.GetValueForProperty("ChannelName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannelInternal)this).ChannelName, global::System.Convert.ToString); - } - if (content.Contains("PropertiesEtag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannelInternal)this).PropertiesEtag = (string) content.GetValueForProperty("PropertiesEtag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannelInternal)this).PropertiesEtag, global::System.Convert.ToString); - } - if (content.Contains("PropertiesProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannelInternal)this).PropertiesProvisioningState = (string) content.GetValueForProperty("PropertiesProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannelInternal)this).PropertiesProvisioningState, global::System.Convert.ToString); - } - if (content.Contains("PropertiesLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannelInternal)this).PropertiesLocation = (string) content.GetValueForProperty("PropertiesLocation",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannelInternal)this).PropertiesLocation, global::System.Convert.ToString); - } - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannel) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ChannelTypeConverter.ConvertFrom); - } - if (content.Contains("ResourceChannelName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).ResourceChannelName = (string) content.GetValueForProperty("ResourceChannelName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).ResourceChannelName, global::System.Convert.ToString); - } - if (content.Contains("ResourceEtag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).ResourceEtag = (string) content.GetValueForProperty("ResourceEtag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).ResourceEtag, global::System.Convert.ToString); - } - if (content.Contains("ResourceProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).ResourceProvisioningState = (string) content.GetValueForProperty("ResourceProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).ResourceProvisioningState, global::System.Convert.ToString); - } - if (content.Contains("ResourceLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).ResourceLocation = (string) content.GetValueForProperty("ResourceLocation",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).ResourceLocation, global::System.Convert.ToString); - } - if (content.Contains("SettingExtensionKey1")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).SettingExtensionKey1 = (string) content.GetValueForProperty("SettingExtensionKey1",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).SettingExtensionKey1, global::System.Convert.ToString); - } - if (content.Contains("SettingExtensionKey2")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).SettingExtensionKey2 = (string) content.GetValueForProperty("SettingExtensionKey2",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).SettingExtensionKey2, global::System.Convert.ToString); - } - if (content.Contains("SettingSite")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).SettingSite = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISite[]) content.GetValueForProperty("SettingSite",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).SettingSite, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SiteTypeConverter.ConvertFrom)); - } - if (content.Contains("SettingChannelId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).SettingChannelId = (string) content.GetValueForProperty("SettingChannelId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).SettingChannelId, global::System.Convert.ToString); - } - if (content.Contains("SettingChannelDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).SettingChannelDisplayName = (string) content.GetValueForProperty("SettingChannelDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).SettingChannelDisplayName, global::System.Convert.ToString); - } - if (content.Contains("SettingBotId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).SettingBotId = (string) content.GetValueForProperty("SettingBotId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).SettingBotId, global::System.Convert.ToString); - } - if (content.Contains("SettingBotIconUrl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).SettingBotIconUrl = (string) content.GetValueForProperty("SettingBotIconUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).SettingBotIconUrl, global::System.Convert.ToString); - } - if (content.Contains("SettingIsEnabled")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).SettingIsEnabled = (bool?) content.GetValueForProperty("SettingIsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).SettingIsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("SettingDisableLocalAuth")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).SettingDisableLocalAuth = (bool?) content.GetValueForProperty("SettingDisableLocalAuth",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal)this).SettingDisableLocalAuth, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - AfterDeserializePSObject(content); - } - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// The ARM channel of list channel with keys operation response. - [System.ComponentModel.TypeConverter(typeof(ListChannelWithKeysResponseTypeConverter))] - public partial interface IListChannelWithKeysResponse - - { - - } -} \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Bot.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/Bot.PowerShell.cs new file mode 100644 index 000000000000..86016076286a --- /dev/null +++ b/generated/BotService/BotService.Autorest/generated/api/Models/Bot.PowerShell.cs @@ -0,0 +1,532 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; + + /// Bot resource definition + [System.ComponentModel.TypeConverter(typeof(BotTypeConverter))] + public partial class Bot + { + + /// + /// 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 Bot(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.BotService.Models.IBotInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.BotPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).SkuName, global::System.Convert.ToString); + } + if (content.Contains("SkuTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).SkuTier = (string) content.GetValueForProperty("SkuTier",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).SkuTier, global::System.Convert.ToString); + } + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.SkuTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Kind = (string) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Kind, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Zone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Zone = (System.Collections.Generic.List) content.GetValueForProperty("Zone",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Zone, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("IconUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).IconUrl = (string) content.GetValueForProperty("IconUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).IconUrl, global::System.Convert.ToString); + } + if (content.Contains("Endpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).Endpoint = (string) content.GetValueForProperty("Endpoint",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).Endpoint, global::System.Convert.ToString); + } + if (content.Contains("EndpointVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).EndpointVersion = (string) content.GetValueForProperty("EndpointVersion",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).EndpointVersion, global::System.Convert.ToString); + } + if (content.Contains("AllSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).AllSetting = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesAllSettings) content.GetValueForProperty("AllSetting",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).AllSetting, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.BotPropertiesAllSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("Parameter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).Parameter = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesParameters) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).Parameter, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.BotPropertiesParametersTypeConverter.ConvertFrom); + } + if (content.Contains("ManifestUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).ManifestUrl = (string) content.GetValueForProperty("ManifestUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).ManifestUrl, global::System.Convert.ToString); + } + if (content.Contains("MsaAppType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).MsaAppType = (string) content.GetValueForProperty("MsaAppType",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).MsaAppType, global::System.Convert.ToString); + } + if (content.Contains("MsaAppId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).MsaAppId = (string) content.GetValueForProperty("MsaAppId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).MsaAppId, global::System.Convert.ToString); + } + if (content.Contains("MsaAppTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).MsaAppTenantId = (string) content.GetValueForProperty("MsaAppTenantId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).MsaAppTenantId, global::System.Convert.ToString); + } + if (content.Contains("MsaAppMsiResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).MsaAppMsiResourceId = (string) content.GetValueForProperty("MsaAppMsiResourceId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).MsaAppMsiResourceId, global::System.Convert.ToString); + } + if (content.Contains("ConfiguredChannel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).ConfiguredChannel = (System.Collections.Generic.List) content.GetValueForProperty("ConfiguredChannel",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).ConfiguredChannel, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("EnabledChannel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).EnabledChannel = (System.Collections.Generic.List) content.GetValueForProperty("EnabledChannel",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).EnabledChannel, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("DeveloperAppInsightKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).DeveloperAppInsightKey = (string) content.GetValueForProperty("DeveloperAppInsightKey",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).DeveloperAppInsightKey, global::System.Convert.ToString); + } + if (content.Contains("DeveloperAppInsightsApiKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).DeveloperAppInsightsApiKey = (string) content.GetValueForProperty("DeveloperAppInsightsApiKey",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).DeveloperAppInsightsApiKey, global::System.Convert.ToString); + } + if (content.Contains("DeveloperAppInsightsApplicationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).DeveloperAppInsightsApplicationId = (string) content.GetValueForProperty("DeveloperAppInsightsApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).DeveloperAppInsightsApplicationId, global::System.Convert.ToString); + } + if (content.Contains("LuisAppId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).LuisAppId = (System.Collections.Generic.List) content.GetValueForProperty("LuisAppId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).LuisAppId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("LuisKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).LuisKey = (string) content.GetValueForProperty("LuisKey",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).LuisKey, global::System.Convert.ToString); + } + if (content.Contains("IsCmekEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).IsCmekEnabled = (bool?) content.GetValueForProperty("IsCmekEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).IsCmekEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("CmekKeyVaultUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).CmekKeyVaultUrl = (string) content.GetValueForProperty("CmekKeyVaultUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).CmekKeyVaultUrl, global::System.Convert.ToString); + } + if (content.Contains("CmekEncryptionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).CmekEncryptionStatus = (string) content.GetValueForProperty("CmekEncryptionStatus",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).CmekEncryptionStatus, global::System.Convert.ToString); + } + if (content.Contains("TenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).TenantId, global::System.Convert.ToString); + } + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).PublicNetworkAccess = (string) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).PublicNetworkAccess, global::System.Convert.ToString); + } + if (content.Contains("IsStreamingSupported")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).IsStreamingSupported = (bool?) content.GetValueForProperty("IsStreamingSupported",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).IsStreamingSupported, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsDeveloperAppInsightsApiKeySet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).IsDeveloperAppInsightsApiKeySet = (bool?) content.GetValueForProperty("IsDeveloperAppInsightsApiKeySet",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).IsDeveloperAppInsightsApiKeySet, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MigrationToken")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).MigrationToken = (string) content.GetValueForProperty("MigrationToken",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).MigrationToken, global::System.Convert.ToString); + } + if (content.Contains("DisableLocalAuth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).DisableLocalAuth = (bool?) content.GetValueForProperty("DisableLocalAuth",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).DisableLocalAuth, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SchemaTransformationVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).SchemaTransformationVersion = (string) content.GetValueForProperty("SchemaTransformationVersion",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).SchemaTransformationVersion, global::System.Convert.ToString); + } + if (content.Contains("StorageResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).StorageResourceId = (string) content.GetValueForProperty("StorageResourceId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).StorageResourceId, global::System.Convert.ToString); + } + if (content.Contains("PrivateEndpointConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).PrivateEndpointConnection = (System.Collections.Generic.List) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.PrivateEndpointConnectionTypeConverter.ConvertFrom)); + } + if (content.Contains("OpenWithHint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).OpenWithHint = (string) content.GetValueForProperty("OpenWithHint",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).OpenWithHint, global::System.Convert.ToString); + } + if (content.Contains("AppPasswordHint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).AppPasswordHint = (string) content.GetValueForProperty("AppPasswordHint",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).AppPasswordHint, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("PublishingCredentials")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).PublishingCredentials = (string) content.GetValueForProperty("PublishingCredentials",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).PublishingCredentials, 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 Bot(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.BotService.Models.IBotInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.BotPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).SkuName, global::System.Convert.ToString); + } + if (content.Contains("SkuTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).SkuTier = (string) content.GetValueForProperty("SkuTier",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).SkuTier, global::System.Convert.ToString); + } + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.SkuTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Kind = (string) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Kind, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Zone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Zone = (System.Collections.Generic.List) content.GetValueForProperty("Zone",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Zone, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("IconUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).IconUrl = (string) content.GetValueForProperty("IconUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).IconUrl, global::System.Convert.ToString); + } + if (content.Contains("Endpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).Endpoint = (string) content.GetValueForProperty("Endpoint",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).Endpoint, global::System.Convert.ToString); + } + if (content.Contains("EndpointVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).EndpointVersion = (string) content.GetValueForProperty("EndpointVersion",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).EndpointVersion, global::System.Convert.ToString); + } + if (content.Contains("AllSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).AllSetting = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesAllSettings) content.GetValueForProperty("AllSetting",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).AllSetting, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.BotPropertiesAllSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("Parameter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).Parameter = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesParameters) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).Parameter, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.BotPropertiesParametersTypeConverter.ConvertFrom); + } + if (content.Contains("ManifestUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).ManifestUrl = (string) content.GetValueForProperty("ManifestUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).ManifestUrl, global::System.Convert.ToString); + } + if (content.Contains("MsaAppType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).MsaAppType = (string) content.GetValueForProperty("MsaAppType",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).MsaAppType, global::System.Convert.ToString); + } + if (content.Contains("MsaAppId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).MsaAppId = (string) content.GetValueForProperty("MsaAppId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).MsaAppId, global::System.Convert.ToString); + } + if (content.Contains("MsaAppTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).MsaAppTenantId = (string) content.GetValueForProperty("MsaAppTenantId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).MsaAppTenantId, global::System.Convert.ToString); + } + if (content.Contains("MsaAppMsiResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).MsaAppMsiResourceId = (string) content.GetValueForProperty("MsaAppMsiResourceId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).MsaAppMsiResourceId, global::System.Convert.ToString); + } + if (content.Contains("ConfiguredChannel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).ConfiguredChannel = (System.Collections.Generic.List) content.GetValueForProperty("ConfiguredChannel",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).ConfiguredChannel, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("EnabledChannel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).EnabledChannel = (System.Collections.Generic.List) content.GetValueForProperty("EnabledChannel",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).EnabledChannel, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("DeveloperAppInsightKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).DeveloperAppInsightKey = (string) content.GetValueForProperty("DeveloperAppInsightKey",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).DeveloperAppInsightKey, global::System.Convert.ToString); + } + if (content.Contains("DeveloperAppInsightsApiKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).DeveloperAppInsightsApiKey = (string) content.GetValueForProperty("DeveloperAppInsightsApiKey",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).DeveloperAppInsightsApiKey, global::System.Convert.ToString); + } + if (content.Contains("DeveloperAppInsightsApplicationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).DeveloperAppInsightsApplicationId = (string) content.GetValueForProperty("DeveloperAppInsightsApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).DeveloperAppInsightsApplicationId, global::System.Convert.ToString); + } + if (content.Contains("LuisAppId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).LuisAppId = (System.Collections.Generic.List) content.GetValueForProperty("LuisAppId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).LuisAppId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("LuisKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).LuisKey = (string) content.GetValueForProperty("LuisKey",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).LuisKey, global::System.Convert.ToString); + } + if (content.Contains("IsCmekEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).IsCmekEnabled = (bool?) content.GetValueForProperty("IsCmekEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).IsCmekEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("CmekKeyVaultUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).CmekKeyVaultUrl = (string) content.GetValueForProperty("CmekKeyVaultUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).CmekKeyVaultUrl, global::System.Convert.ToString); + } + if (content.Contains("CmekEncryptionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).CmekEncryptionStatus = (string) content.GetValueForProperty("CmekEncryptionStatus",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).CmekEncryptionStatus, global::System.Convert.ToString); + } + if (content.Contains("TenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).TenantId, global::System.Convert.ToString); + } + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).PublicNetworkAccess = (string) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).PublicNetworkAccess, global::System.Convert.ToString); + } + if (content.Contains("IsStreamingSupported")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).IsStreamingSupported = (bool?) content.GetValueForProperty("IsStreamingSupported",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).IsStreamingSupported, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsDeveloperAppInsightsApiKeySet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).IsDeveloperAppInsightsApiKeySet = (bool?) content.GetValueForProperty("IsDeveloperAppInsightsApiKeySet",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).IsDeveloperAppInsightsApiKeySet, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MigrationToken")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).MigrationToken = (string) content.GetValueForProperty("MigrationToken",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).MigrationToken, global::System.Convert.ToString); + } + if (content.Contains("DisableLocalAuth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).DisableLocalAuth = (bool?) content.GetValueForProperty("DisableLocalAuth",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).DisableLocalAuth, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SchemaTransformationVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).SchemaTransformationVersion = (string) content.GetValueForProperty("SchemaTransformationVersion",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).SchemaTransformationVersion, global::System.Convert.ToString); + } + if (content.Contains("StorageResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).StorageResourceId = (string) content.GetValueForProperty("StorageResourceId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).StorageResourceId, global::System.Convert.ToString); + } + if (content.Contains("PrivateEndpointConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).PrivateEndpointConnection = (System.Collections.Generic.List) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.PrivateEndpointConnectionTypeConverter.ConvertFrom)); + } + if (content.Contains("OpenWithHint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).OpenWithHint = (string) content.GetValueForProperty("OpenWithHint",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).OpenWithHint, global::System.Convert.ToString); + } + if (content.Contains("AppPasswordHint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).AppPasswordHint = (string) content.GetValueForProperty("AppPasswordHint",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).AppPasswordHint, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("PublishingCredentials")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).PublishingCredentials = (string) content.GetValueForProperty("PublishingCredentials",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal)this).PublishingCredentials, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Bot(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.BotService.Models.IBot DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Bot(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.BotService.Models.IBot FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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(); + } + } + /// Bot resource definition + [System.ComponentModel.TypeConverter(typeof(BotTypeConverter))] + public partial interface IBot + + { + + } +} \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Bot.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/Bot.TypeConverter.cs similarity index 97% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Bot.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/Bot.TypeConverter.cs index ceb4e7e59f06..e7da25c68aea 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Bot.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/Bot.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IBot ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Bot.cs b/generated/BotService/BotService.Autorest/generated/api/Models/Bot.cs similarity index 62% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Bot.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/Bot.cs index 4bfa397546d0..7c698b3b16bd 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Bot.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/Bot.cs @@ -3,258 +3,264 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// Bot resource definition public partial class Bot : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Resource(); + private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Resource(); /// Contains resource all settings defined as key/value pairs. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesAllSettings AllSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).AllSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).AllSetting = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesAllSettings AllSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).AllSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).AllSetting = value ?? null /* model class */; } /// The hint (e.g. keyVault secret resourceId) on how to fetch the app secret [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string AppPasswordHint { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).AppPasswordHint; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).AppPasswordHint = value ?? null; } + public string AppPasswordHint { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).AppPasswordHint; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).AppPasswordHint = value ?? null; } /// The CMK encryption status [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string CmekEncryptionStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).CmekEncryptionStatus; } + public string CmekEncryptionStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).CmekEncryptionStatus; } /// The CMK Url [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string CmekKeyVaultUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).CmekKeyVaultUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).CmekKeyVaultUrl = value ?? null; } + public string CmekKeyVaultUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).CmekKeyVaultUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).CmekKeyVaultUrl = value ?? null; } /// Collection of channels for which the bot is configured [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string[] ConfiguredChannel { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).ConfiguredChannel; } + public System.Collections.Generic.List ConfiguredChannel { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).ConfiguredChannel; } /// The description of the bot [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).Description = value ?? null; } + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).Description = value ?? null; } /// The Application Insights key [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string DeveloperAppInsightKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).DeveloperAppInsightKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).DeveloperAppInsightKey = value ?? null; } + public string DeveloperAppInsightKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).DeveloperAppInsightKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).DeveloperAppInsightKey = value ?? null; } /// The Application Insights Api Key [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string DeveloperAppInsightsApiKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).DeveloperAppInsightsApiKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).DeveloperAppInsightsApiKey = value ?? null; } + public string DeveloperAppInsightsApiKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).DeveloperAppInsightsApiKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).DeveloperAppInsightsApiKey = value ?? null; } /// The Application Insights App Id [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string DeveloperAppInsightsApplicationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).DeveloperAppInsightsApplicationId; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).DeveloperAppInsightsApplicationId = value ?? null; } + public string DeveloperAppInsightsApplicationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).DeveloperAppInsightsApplicationId; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).DeveloperAppInsightsApplicationId = value ?? null; } /// /// Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. /// [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public bool? DisableLocalAuth { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).DisableLocalAuth; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).DisableLocalAuth = value ?? default(bool); } + public bool? DisableLocalAuth { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).DisableLocalAuth; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).DisableLocalAuth = value ?? default(bool); } /// The Name of the bot [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).DisplayName = value ?? null; } + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).DisplayName = value ?? null; } /// Collection of channels for which the bot is enabled [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string[] EnabledChannel { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).EnabledChannel; } + public System.Collections.Generic.List EnabledChannel { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).EnabledChannel; } /// The bot's endpoint [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string Endpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).Endpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).Endpoint = value ?? null; } + public string Endpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).Endpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).Endpoint = value ?? null; } /// The bot's endpoint version [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string EndpointVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).EndpointVersion; } + public string EndpointVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).EndpointVersion; } /// Entity Tag [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Etag = value ?? null; } + public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Etag = value ?? null; } /// The Icon Url of the bot [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string IconUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).IconUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).IconUrl = value ?? null; } + public string IconUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).IconUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).IconUrl = value ?? null; } /// Specifies the resource ID. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Id; } /// Whether Cmek is enabled [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public bool? IsCmekEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).IsCmekEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).IsCmekEnabled = value ?? default(bool); } + public bool? IsCmekEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).IsCmekEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).IsCmekEnabled = value ?? default(bool); } /// Whether the bot is developerAppInsightsApiKey set [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public bool? IsDeveloperAppInsightsApiKeySet { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).IsDeveloperAppInsightsApiKeySet; } + public bool? IsDeveloperAppInsightsApiKeySet { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).IsDeveloperAppInsightsApiKeySet; } /// Whether the bot is streaming supported [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public bool? IsStreamingSupported { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).IsStreamingSupported; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).IsStreamingSupported = value ?? default(bool); } + public bool? IsStreamingSupported { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).IsStreamingSupported; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).IsStreamingSupported = value ?? default(bool); } /// Required. Gets or sets the Kind of the resource. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Kind? Kind { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Kind; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Kind = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Kind)""); } + public string Kind { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Kind; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Kind = value ?? null; } /// Specifies the location of the resource. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Location = value ?? null; } + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Location = value ?? null; } /// Collection of LUIS App Ids [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string[] LuisAppId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).LuisAppId; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).LuisAppId = value ?? null /* arrayOf */; } + public System.Collections.Generic.List LuisAppId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).LuisAppId; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).LuisAppId = value ?? null /* arrayOf */; } /// The LUIS Key [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string LuisKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).LuisKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).LuisKey = value ?? null; } + public string LuisKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).LuisKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).LuisKey = value ?? null; } /// The bot's manifest url [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string ManifestUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).ManifestUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).ManifestUrl = value ?? null; } + public string ManifestUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).ManifestUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).ManifestUrl = value ?? null; } /// Internal Acessors for CmekEncryptionStatus - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal.CmekEncryptionStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).CmekEncryptionStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).CmekEncryptionStatus = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal.CmekEncryptionStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).CmekEncryptionStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).CmekEncryptionStatus = value; } /// Internal Acessors for ConfiguredChannel - string[] Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal.ConfiguredChannel { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).ConfiguredChannel; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).ConfiguredChannel = value; } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal.ConfiguredChannel { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).ConfiguredChannel; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).ConfiguredChannel = value; } /// Internal Acessors for EnabledChannel - string[] Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal.EnabledChannel { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).EnabledChannel; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).EnabledChannel = value; } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal.EnabledChannel { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).EnabledChannel; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).EnabledChannel = value; } /// Internal Acessors for EndpointVersion - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal.EndpointVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).EndpointVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).EndpointVersion = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal.EndpointVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).EndpointVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).EndpointVersion = value; } /// Internal Acessors for IsDeveloperAppInsightsApiKeySet - bool? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal.IsDeveloperAppInsightsApiKeySet { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).IsDeveloperAppInsightsApiKeySet; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).IsDeveloperAppInsightsApiKeySet = value; } + bool? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal.IsDeveloperAppInsightsApiKeySet { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).IsDeveloperAppInsightsApiKeySet; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).IsDeveloperAppInsightsApiKeySet = value; } /// Internal Acessors for MigrationToken - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal.MigrationToken { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).MigrationToken; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).MigrationToken = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal.MigrationToken { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).MigrationToken; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).MigrationToken = value; } /// Internal Acessors for PrivateEndpointConnection - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnection[] Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal.PrivateEndpointConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).PrivateEndpointConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).PrivateEndpointConnection = value; } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal.PrivateEndpointConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).PrivateEndpointConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).PrivateEndpointConnection = value; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotProperties Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.BotProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotProperties Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.BotProperties()); set { {_property = value;} } } /// Internal Acessors for ProvisioningState - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).ProvisioningState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).ProvisioningState = value; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Id = value; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Sku + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISku Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal.Sku { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Sku; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Sku = value; } /// Internal Acessors for SkuTier - Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuTier? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal.SkuTier { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).SkuTier; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).SkuTier = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal.SkuTier { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).SkuTier; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).SkuTier = value; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Type = value; } /// Internal Acessors for Zone - string[] Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal.Zone { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Zone; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Zone = value; } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal.Zone { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Zone; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Zone = value; } /// Token used to migrate non Azure bot to azure subscription [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string MigrationToken { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).MigrationToken; } + public string MigrationToken { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).MigrationToken; } /// Microsoft App Id for the bot [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string MsaAppId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).MsaAppId; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).MsaAppId = value ?? null; } + public string MsaAppId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).MsaAppId; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).MsaAppId = value ?? null; } /// Microsoft App Managed Identity Resource Id for the bot [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string MsaAppMsiResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).MsaAppMsiResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).MsaAppMsiResourceId = value ?? null; } + public string MsaAppMsiResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).MsaAppMsiResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).MsaAppMsiResourceId = value ?? null; } /// Microsoft App Tenant Id for the bot [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string MsaAppTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).MsaAppTenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).MsaAppTenantId = value ?? null; } + public string MsaAppTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).MsaAppTenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).MsaAppTenantId = value ?? null; } /// Microsoft App Type for the bot [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.MsaAppType? MsaAppType { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).MsaAppType; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).MsaAppType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.MsaAppType)""); } + public string MsaAppType { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).MsaAppType; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).MsaAppType = value ?? null; } /// Specifies the name of the resource. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Name; } /// /// The hint to browser (e.g. protocol handler) on how to open the bot for authoring /// [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string OpenWithHint { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).OpenWithHint; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).OpenWithHint = value ?? null; } + public string OpenWithHint { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).OpenWithHint; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).OpenWithHint = value ?? null; } /// Contains resource parameters defined as key/value pairs. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesParameters Parameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).Parameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).Parameter = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesParameters Parameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).Parameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).Parameter = value ?? null /* model class */; } /// List of Private Endpoint Connections configured for the bot [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnection[] PrivateEndpointConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).PrivateEndpointConnection; } + public System.Collections.Generic.List PrivateEndpointConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).PrivateEndpointConnection; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotProperties _property; /// The set of properties specific to bot resource [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.BotProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.BotProperties()); set => this._property = value; } /// Provisioning state of the resource [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).ProvisioningState; } + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).ProvisioningState; } /// Whether the bot is in an isolated network [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PublicNetworkAccess? PublicNetworkAccess { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).PublicNetworkAccess; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).PublicNetworkAccess = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PublicNetworkAccess)""); } + public string PublicNetworkAccess { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).PublicNetworkAccess; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).PublicNetworkAccess = value ?? null; } /// Publishing credentials of the resource [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string PublishingCredentials { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).PublishingCredentials; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).PublishingCredentials = value ?? null; } + public string PublishingCredentials { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).PublishingCredentials; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).PublishingCredentials = value ?? null; } + + /// Gets the resource group name + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.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 channel schema transformation version for the bot [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string SchemaTransformationVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).SchemaTransformationVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).SchemaTransformationVersion = value ?? null; } + public string SchemaTransformationVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).SchemaTransformationVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).SchemaTransformationVersion = value ?? null; } /// Gets or sets the SKU of the resource. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISku Sku { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Sku; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Sku = value ?? null /* model class */; } + internal Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISku Sku { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Sku; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Sku = value ?? null /* model class */; } /// The sku name [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName? SkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).SkuName; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).SkuName = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName)""); } + public string SkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).SkuName; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).SkuName = value ?? null; } /// Gets the sku tier. This is based on the SKU name. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuTier? SkuTier { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).SkuTier; } + public string SkuTier { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).SkuTier; } /// The storage resourceId for the bot [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string StorageResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).StorageResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).StorageResourceId = value ?? null; } + public string StorageResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).StorageResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).StorageResourceId = value ?? null; } /// Contains resource tags defined as key/value pairs. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Tag = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Tag = value ?? null /* model class */; } /// The Tenant Id for the bot [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string TenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal)Property).TenantId = value ?? null; } + public string TenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)Property).TenantId = value ?? null; } /// Specifies the type of the resource. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Type; } /// Entity zones [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string[] Zone { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Zone; } + public System.Collections.Generic.List Zone { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Zone; } /// Creates an new instance. public Bot() @@ -277,20 +283,26 @@ public Bot() /// Bot resource definition public partial interface IBot : Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResource + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResource { /// Contains resource all settings defined as key/value pairs. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Contains resource all settings defined as key/value pairs.", SerializedName = @"allSettings", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesAllSettings) })] - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesAllSettings AllSetting { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesAllSettings) })] + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesAllSettings AllSetting { get; set; } /// The hint (e.g. keyVault secret resourceId) on how to fetch the app secret [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The hint (e.g. keyVault secret resourceId) on how to fetch the app secret", SerializedName = @"appPasswordHint", PossibleTypes = new [] { typeof(string) })] @@ -299,6 +311,9 @@ public partial interface IBot : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The CMK encryption status", SerializedName = @"cmekEncryptionStatus", PossibleTypes = new [] { typeof(string) })] @@ -307,6 +322,9 @@ public partial interface IBot : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The CMK Url", SerializedName = @"cmekKeyVaultUrl", PossibleTypes = new [] { typeof(string) })] @@ -315,14 +333,20 @@ public partial interface IBot : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Collection of channels for which the bot is configured", SerializedName = @"configuredChannels", PossibleTypes = new [] { typeof(string) })] - string[] ConfiguredChannel { get; } + System.Collections.Generic.List ConfiguredChannel { get; } /// The description of the bot [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The description of the bot", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -331,6 +355,9 @@ public partial interface IBot : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The Application Insights key", SerializedName = @"developerAppInsightKey", PossibleTypes = new [] { typeof(string) })] @@ -339,6 +366,9 @@ public partial interface IBot : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The Application Insights Api Key", SerializedName = @"developerAppInsightsApiKey", PossibleTypes = new [] { typeof(string) })] @@ -347,6 +377,9 @@ public partial interface IBot : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The Application Insights App Id", SerializedName = @"developerAppInsightsApplicationId", PossibleTypes = new [] { typeof(string) })] @@ -357,6 +390,9 @@ public partial interface IBot : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication.", SerializedName = @"disableLocalAuth", PossibleTypes = new [] { typeof(bool) })] @@ -365,6 +401,9 @@ public partial interface IBot : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The Name of the bot", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -373,14 +412,20 @@ public partial interface IBot : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Collection of channels for which the bot is enabled", SerializedName = @"enabledChannels", PossibleTypes = new [] { typeof(string) })] - string[] EnabledChannel { get; } + System.Collections.Generic.List EnabledChannel { get; } /// The bot's endpoint [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The bot's endpoint", SerializedName = @"endpoint", PossibleTypes = new [] { typeof(string) })] @@ -389,6 +434,9 @@ public partial interface IBot : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The bot's endpoint version", SerializedName = @"endpointVersion", PossibleTypes = new [] { typeof(string) })] @@ -397,6 +445,9 @@ public partial interface IBot : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The Icon Url of the bot", SerializedName = @"iconUrl", PossibleTypes = new [] { typeof(string) })] @@ -405,6 +456,9 @@ public partial interface IBot : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Whether Cmek is enabled", SerializedName = @"isCmekEnabled", PossibleTypes = new [] { typeof(bool) })] @@ -413,6 +467,9 @@ public partial interface IBot : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Whether the bot is developerAppInsightsApiKey set", SerializedName = @"isDeveloperAppInsightsApiKeySet", PossibleTypes = new [] { typeof(bool) })] @@ -421,6 +478,9 @@ public partial interface IBot : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Whether the bot is streaming supported", SerializedName = @"isStreamingSupported", PossibleTypes = new [] { typeof(bool) })] @@ -429,14 +489,20 @@ public partial interface IBot : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Collection of LUIS App Ids", SerializedName = @"luisAppIds", PossibleTypes = new [] { typeof(string) })] - string[] LuisAppId { get; set; } + System.Collections.Generic.List LuisAppId { get; set; } /// The LUIS Key [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The LUIS Key", SerializedName = @"luisKey", PossibleTypes = new [] { typeof(string) })] @@ -445,6 +511,9 @@ public partial interface IBot : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The bot's manifest url", SerializedName = @"manifestUrl", PossibleTypes = new [] { typeof(string) })] @@ -453,6 +522,9 @@ public partial interface IBot : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Token used to migrate non Azure bot to azure subscription", SerializedName = @"migrationToken", PossibleTypes = new [] { typeof(string) })] @@ -461,6 +533,9 @@ public partial interface IBot : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = false, Description = @"Microsoft App Id for the bot", SerializedName = @"msaAppId", PossibleTypes = new [] { typeof(string) })] @@ -469,6 +544,9 @@ public partial interface IBot : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Microsoft App Managed Identity Resource Id for the bot", SerializedName = @"msaAppMSIResourceId", PossibleTypes = new [] { typeof(string) })] @@ -477,6 +555,9 @@ public partial interface IBot : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = false, Description = @"Microsoft App Tenant Id for the bot", SerializedName = @"msaAppTenantId", PossibleTypes = new [] { typeof(string) })] @@ -485,16 +566,23 @@ public partial interface IBot : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Microsoft App Type for the bot", SerializedName = @"msaAppType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.MsaAppType) })] - Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.MsaAppType? MsaAppType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("UserAssignedMSI", "SingleTenant", "MultiTenant")] + string MsaAppType { get; set; } /// /// The hint to browser (e.g. protocol handler) on how to open the bot for authoring /// [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The hint to browser (e.g. protocol handler) on how to open the bot for authoring", SerializedName = @"openWithHint", PossibleTypes = new [] { typeof(string) })] @@ -503,22 +591,31 @@ public partial interface IBot : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Contains resource parameters defined as key/value pairs.", SerializedName = @"parameters", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesParameters) })] - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesParameters Parameter { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesParameters) })] + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesParameters Parameter { get; set; } /// List of Private Endpoint Connections configured for the bot [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"List of Private Endpoint Connections configured for the bot", SerializedName = @"privateEndpointConnections", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnection) })] - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnection[] PrivateEndpointConnection { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnection) })] + System.Collections.Generic.List PrivateEndpointConnection { get; } /// Provisioning state of the resource [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Provisioning state of the resource", SerializedName = @"provisioningState", PossibleTypes = new [] { typeof(string) })] @@ -527,14 +624,21 @@ public partial interface IBot : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Whether the bot is in an isolated network", SerializedName = @"publicNetworkAccess", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PublicNetworkAccess) })] - Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string PublicNetworkAccess { get; set; } /// Publishing credentials of the resource [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Publishing credentials of the resource", SerializedName = @"publishingCredentials", PossibleTypes = new [] { typeof(string) })] @@ -543,6 +647,9 @@ public partial interface IBot : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The channel schema transformation version for the bot", SerializedName = @"schemaTransformationVersion", PossibleTypes = new [] { typeof(string) })] @@ -551,6 +658,9 @@ public partial interface IBot : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The storage resourceId for the bot", SerializedName = @"storageResourceId", PossibleTypes = new [] { typeof(string) })] @@ -559,6 +669,9 @@ public partial interface IBot : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = false, Description = @"The Tenant Id for the bot", SerializedName = @"tenantId", PossibleTypes = new [] { typeof(string) })] @@ -567,10 +680,10 @@ public partial interface IBot : } /// Bot resource definition internal partial interface IBotInternal : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal { /// Contains resource all settings defined as key/value pairs. - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesAllSettings AllSetting { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesAllSettings AllSetting { get; set; } /// The hint (e.g. keyVault secret resourceId) on how to fetch the app secret string AppPasswordHint { get; set; } /// The CMK encryption status @@ -578,7 +691,7 @@ internal partial interface IBotInternal : /// The CMK Url string CmekKeyVaultUrl { get; set; } /// Collection of channels for which the bot is configured - string[] ConfiguredChannel { get; set; } + System.Collections.Generic.List ConfiguredChannel { get; set; } /// The description of the bot string Description { get; set; } /// The Application Insights key @@ -594,7 +707,7 @@ internal partial interface IBotInternal : /// The Name of the bot string DisplayName { get; set; } /// Collection of channels for which the bot is enabled - string[] EnabledChannel { get; set; } + System.Collections.Generic.List EnabledChannel { get; set; } /// The bot's endpoint string Endpoint { get; set; } /// The bot's endpoint version @@ -608,7 +721,7 @@ internal partial interface IBotInternal : /// Whether the bot is streaming supported bool? IsStreamingSupported { get; set; } /// Collection of LUIS App Ids - string[] LuisAppId { get; set; } + System.Collections.Generic.List LuisAppId { get; set; } /// The LUIS Key string LuisKey { get; set; } /// The bot's manifest url @@ -622,21 +735,23 @@ internal partial interface IBotInternal : /// Microsoft App Tenant Id for the bot string MsaAppTenantId { get; set; } /// Microsoft App Type for the bot - Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.MsaAppType? MsaAppType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("UserAssignedMSI", "SingleTenant", "MultiTenant")] + string MsaAppType { get; set; } /// /// The hint to browser (e.g. protocol handler) on how to open the bot for authoring /// string OpenWithHint { get; set; } /// Contains resource parameters defined as key/value pairs. - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesParameters Parameter { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesParameters Parameter { get; set; } /// List of Private Endpoint Connections configured for the bot - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnection[] PrivateEndpointConnection { get; set; } + System.Collections.Generic.List PrivateEndpointConnection { get; set; } /// The set of properties specific to bot resource - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotProperties Property { get; set; } /// Provisioning state of the resource string ProvisioningState { get; set; } /// Whether the bot is in an isolated network - Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string PublicNetworkAccess { get; set; } /// Publishing credentials of the resource string PublishingCredentials { get; set; } /// The channel schema transformation version for the bot diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Bot.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/Bot.json.cs similarity index 91% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Bot.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/Bot.json.cs index 5cc1401cd127..4c1ae7affdc9 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Bot.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/Bot.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -65,19 +65,17 @@ internal Bot(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObje { return; } - __resource = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Resource(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.BotProperties.FromJson(__jsonProperties) : Property;} + __resource = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.BotProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot. + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new Bot(json) : null; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotChannel.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/BotChannel.PowerShell.cs similarity index 51% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotChannel.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/BotChannel.PowerShell.cs index 41a71c3677ac..eccdf1d22dd5 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotChannel.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/BotChannel.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,7 +55,15 @@ public partial class BotChannel 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,73 +78,73 @@ internal BotChannel(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannel) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ChannelTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannel) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ChannelTypeConverter.ConvertFrom); } if (content.Contains("SkuName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).SkuName = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).SkuName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).SkuName, global::System.Convert.ToString); } if (content.Contains("SkuTier")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).SkuTier = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuTier?) content.GetValueForProperty("SkuTier",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).SkuTier, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuTier.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).SkuTier = (string) content.GetValueForProperty("SkuTier",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).SkuTier, global::System.Convert.ToString); } if (content.Contains("Sku")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SkuTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.SkuTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ResourceTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Kind")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Kind?) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Kind.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Kind = (string) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Kind, global::System.Convert.ToString); } if (content.Contains("Etag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Etag, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Etag, global::System.Convert.ToString); } if (content.Contains("Zone")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Zone = (string[]) content.GetValueForProperty("Zone",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Zone, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Zone = (System.Collections.Generic.List) content.GetValueForProperty("Zone",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Zone, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("ChannelName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannelInternal)this).ChannelName = (string) content.GetValueForProperty("ChannelName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannelInternal)this).ChannelName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannelInternal)this).ChannelName = (string) content.GetValueForProperty("ChannelName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannelInternal)this).ChannelName, global::System.Convert.ToString); } if (content.Contains("PropertiesEtag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannelInternal)this).PropertiesEtag = (string) content.GetValueForProperty("PropertiesEtag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannelInternal)this).PropertiesEtag, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannelInternal)this).PropertiesEtag = (string) content.GetValueForProperty("PropertiesEtag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannelInternal)this).PropertiesEtag, global::System.Convert.ToString); } if (content.Contains("PropertiesProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannelInternal)this).PropertiesProvisioningState = (string) content.GetValueForProperty("PropertiesProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannelInternal)this).PropertiesProvisioningState, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannelInternal)this).PropertiesProvisioningState = (string) content.GetValueForProperty("PropertiesProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannelInternal)this).PropertiesProvisioningState, global::System.Convert.ToString); } if (content.Contains("PropertiesLocation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannelInternal)this).PropertiesLocation = (string) content.GetValueForProperty("PropertiesLocation",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannelInternal)this).PropertiesLocation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannelInternal)this).PropertiesLocation = (string) content.GetValueForProperty("PropertiesLocation",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannelInternal)this).PropertiesLocation, 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. @@ -151,93 +159,93 @@ internal BotChannel(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannel) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ChannelTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannel) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ChannelTypeConverter.ConvertFrom); } if (content.Contains("SkuName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).SkuName = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).SkuName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).SkuName, global::System.Convert.ToString); } if (content.Contains("SkuTier")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).SkuTier = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuTier?) content.GetValueForProperty("SkuTier",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).SkuTier, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuTier.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).SkuTier = (string) content.GetValueForProperty("SkuTier",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).SkuTier, global::System.Convert.ToString); } if (content.Contains("Sku")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SkuTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.SkuTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ResourceTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Kind")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Kind?) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Kind.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Kind = (string) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Kind, global::System.Convert.ToString); } if (content.Contains("Etag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Etag, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Etag, global::System.Convert.ToString); } if (content.Contains("Zone")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Zone = (string[]) content.GetValueForProperty("Zone",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Zone, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Zone = (System.Collections.Generic.List) content.GetValueForProperty("Zone",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Zone, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("ChannelName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannelInternal)this).ChannelName = (string) content.GetValueForProperty("ChannelName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannelInternal)this).ChannelName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannelInternal)this).ChannelName = (string) content.GetValueForProperty("ChannelName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannelInternal)this).ChannelName, global::System.Convert.ToString); } if (content.Contains("PropertiesEtag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannelInternal)this).PropertiesEtag = (string) content.GetValueForProperty("PropertiesEtag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannelInternal)this).PropertiesEtag, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannelInternal)this).PropertiesEtag = (string) content.GetValueForProperty("PropertiesEtag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannelInternal)this).PropertiesEtag, global::System.Convert.ToString); } if (content.Contains("PropertiesProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannelInternal)this).PropertiesProvisioningState = (string) content.GetValueForProperty("PropertiesProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannelInternal)this).PropertiesProvisioningState, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannelInternal)this).PropertiesProvisioningState = (string) content.GetValueForProperty("PropertiesProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannelInternal)this).PropertiesProvisioningState, global::System.Convert.ToString); } if (content.Contains("PropertiesLocation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannelInternal)this).PropertiesLocation = (string) content.GetValueForProperty("PropertiesLocation",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannelInternal)this).PropertiesLocation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannelInternal)this).PropertiesLocation = (string) content.GetValueForProperty("PropertiesLocation",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannelInternal)this).PropertiesLocation, 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.BotService.Models.Api20220615Preview.IBotChannel DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannel DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new BotChannel(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.BotService.Models.Api20220615Preview.IBotChannel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new BotChannel(content); } @@ -247,12 +255,24 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Pr /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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(); + } } /// Bot channel resource definition [System.ComponentModel.TypeConverter(typeof(BotChannelTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotChannel.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/BotChannel.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotChannel.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/BotChannel.TypeConverter.cs index 543302087eb2..e0faa91c228c 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotChannel.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/BotChannel.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IBotChannel ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannel ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannel).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannel).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotChannel.cs b/generated/BotService/BotService.Autorest/generated/api/Models/BotChannel.cs similarity index 56% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotChannel.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/BotChannel.cs index 5625f3f226ab..b0dc27307d19 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotChannel.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/BotChannel.cs @@ -3,109 +3,115 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// Bot channel resource definition public partial class BotChannel : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannel, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannelInternal, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannel, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannelInternal, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Resource(); + private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Resource(); /// The channel name [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string ChannelName { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)Property).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)Property).Name = value ?? null; } + public string ChannelName { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)Property).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)Property).Name = value ?? null; } /// Entity Tag [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Etag = value ?? null; } + public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Etag = value ?? null; } /// Specifies the resource ID. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Id; } /// Required. Gets or sets the Kind of the resource. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Kind? Kind { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Kind; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Kind = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Kind)""); } + public string Kind { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Kind; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Kind = value ?? null; } /// Specifies the location of the resource. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Location = value ?? null; } + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Location = value ?? null; } /// Internal Acessors for PropertiesProvisioningState - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannelInternal.PropertiesProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)Property).ProvisioningState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannelInternal.PropertiesProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)Property).ProvisioningState = value; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannel Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannelInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Channel()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannel Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannelInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Channel()); set { {_property = value;} } } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Id = value; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Sku + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISku Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal.Sku { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Sku; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Sku = value; } /// Internal Acessors for SkuTier - Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuTier? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal.SkuTier { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).SkuTier; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).SkuTier = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal.SkuTier { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).SkuTier; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).SkuTier = value; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Type = value; } /// Internal Acessors for Zone - string[] Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal.Zone { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Zone; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Zone = value; } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal.Zone { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Zone; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Zone = value; } /// Specifies the name of the resource. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Name; } /// Entity Tag of the resource [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string PropertiesEtag { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)Property).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)Property).Etag = value ?? null; } + public string PropertiesEtag { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)Property).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)Property).Etag = value ?? null; } /// Specifies the location of the resource. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string PropertiesLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)Property).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)Property).Location = value ?? null; } + public string PropertiesLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)Property).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)Property).Location = value ?? null; } /// Provisioning state of the resource [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string PropertiesProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)Property).ProvisioningState; } + public string PropertiesProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)Property).ProvisioningState; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannel _property; + private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannel _property; /// The set of properties specific to bot channel resource [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannel Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Channel()); set => this._property = value; } + public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannel Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Channel()); set => this._property = value; } + + /// Gets the resource group name + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.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); } /// Gets or sets the SKU of the resource. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISku Sku { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Sku; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Sku = value ?? null /* model class */; } + internal Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISku Sku { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Sku; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Sku = value ?? null /* model class */; } /// The sku name [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName? SkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).SkuName; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).SkuName = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName)""); } + public string SkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).SkuName; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).SkuName = value ?? null; } /// Gets the sku tier. This is based on the SKU name. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuTier? SkuTier { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).SkuTier; } + public string SkuTier { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).SkuTier; } /// Contains resource tags defined as key/value pairs. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Tag = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Tag = value ?? null /* model class */; } /// Specifies the type of the resource. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Type; } /// Entity zones [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string[] Zone { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Zone; } + public System.Collections.Generic.List Zone { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Zone; } /// Creates an new instance. public BotChannel() @@ -128,12 +134,15 @@ public BotChannel() /// Bot channel resource definition public partial interface IBotChannel : Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResource + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResource { /// The channel name [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The channel name", SerializedName = @"channelName", PossibleTypes = new [] { typeof(string) })] @@ -142,6 +151,9 @@ public partial interface IBotChannel : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Entity Tag of the resource", SerializedName = @"etag", PossibleTypes = new [] { typeof(string) })] @@ -150,6 +162,9 @@ public partial interface IBotChannel : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Specifies the location of the resource.", SerializedName = @"location", PossibleTypes = new [] { typeof(string) })] @@ -158,6 +173,9 @@ public partial interface IBotChannel : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Provisioning state of the resource", SerializedName = @"provisioningState", PossibleTypes = new [] { typeof(string) })] @@ -166,7 +184,7 @@ public partial interface IBotChannel : } /// Bot channel resource definition internal partial interface IBotChannelInternal : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal { /// The channel name string ChannelName { get; set; } @@ -177,7 +195,7 @@ internal partial interface IBotChannelInternal : /// Provisioning state of the resource string PropertiesProvisioningState { get; set; } /// The set of properties specific to bot channel resource - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannel Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannel Property { get; set; } } } \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotChannel.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/BotChannel.json.cs similarity index 93% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotChannel.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/BotChannel.json.cs index 7a3d1c107bec..b84f803c6281 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotChannel.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/BotChannel.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -65,19 +65,19 @@ internal BotChannel(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.J { return; } - __resource = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Resource(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Channel.FromJson(__jsonProperties) : Property;} + __resource = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Channel.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannel. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannel. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannel. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannel. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannel FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannel FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new BotChannel(json) : null; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/BotProperties.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/BotProperties.PowerShell.cs new file mode 100644 index 000000000000..262910521929 --- /dev/null +++ b/generated/BotService/BotService.Autorest/generated/api/Models/BotProperties.PowerShell.cs @@ -0,0 +1,436 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; + + /// The parameters to provide for the Bot. + [System.ComponentModel.TypeConverter(typeof(BotPropertiesTypeConverter))] + public partial class BotProperties + { + + /// + /// 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 BotProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("IconUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).IconUrl = (string) content.GetValueForProperty("IconUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).IconUrl, global::System.Convert.ToString); + } + if (content.Contains("Endpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).Endpoint = (string) content.GetValueForProperty("Endpoint",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).Endpoint, global::System.Convert.ToString); + } + if (content.Contains("EndpointVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).EndpointVersion = (string) content.GetValueForProperty("EndpointVersion",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).EndpointVersion, global::System.Convert.ToString); + } + if (content.Contains("AllSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).AllSetting = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesAllSettings) content.GetValueForProperty("AllSetting",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).AllSetting, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.BotPropertiesAllSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("Parameter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).Parameter = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesParameters) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).Parameter, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.BotPropertiesParametersTypeConverter.ConvertFrom); + } + if (content.Contains("ManifestUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).ManifestUrl = (string) content.GetValueForProperty("ManifestUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).ManifestUrl, global::System.Convert.ToString); + } + if (content.Contains("MsaAppType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).MsaAppType = (string) content.GetValueForProperty("MsaAppType",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).MsaAppType, global::System.Convert.ToString); + } + if (content.Contains("MsaAppId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).MsaAppId = (string) content.GetValueForProperty("MsaAppId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).MsaAppId, global::System.Convert.ToString); + } + if (content.Contains("MsaAppTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).MsaAppTenantId = (string) content.GetValueForProperty("MsaAppTenantId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).MsaAppTenantId, global::System.Convert.ToString); + } + if (content.Contains("MsaAppMsiResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).MsaAppMsiResourceId = (string) content.GetValueForProperty("MsaAppMsiResourceId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).MsaAppMsiResourceId, global::System.Convert.ToString); + } + if (content.Contains("ConfiguredChannel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).ConfiguredChannel = (System.Collections.Generic.List) content.GetValueForProperty("ConfiguredChannel",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).ConfiguredChannel, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("EnabledChannel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).EnabledChannel = (System.Collections.Generic.List) content.GetValueForProperty("EnabledChannel",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).EnabledChannel, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("DeveloperAppInsightKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).DeveloperAppInsightKey = (string) content.GetValueForProperty("DeveloperAppInsightKey",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).DeveloperAppInsightKey, global::System.Convert.ToString); + } + if (content.Contains("DeveloperAppInsightsApiKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).DeveloperAppInsightsApiKey = (string) content.GetValueForProperty("DeveloperAppInsightsApiKey",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).DeveloperAppInsightsApiKey, global::System.Convert.ToString); + } + if (content.Contains("DeveloperAppInsightsApplicationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).DeveloperAppInsightsApplicationId = (string) content.GetValueForProperty("DeveloperAppInsightsApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).DeveloperAppInsightsApplicationId, global::System.Convert.ToString); + } + if (content.Contains("LuisAppId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).LuisAppId = (System.Collections.Generic.List) content.GetValueForProperty("LuisAppId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).LuisAppId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("LuisKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).LuisKey = (string) content.GetValueForProperty("LuisKey",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).LuisKey, global::System.Convert.ToString); + } + if (content.Contains("IsCmekEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).IsCmekEnabled = (bool?) content.GetValueForProperty("IsCmekEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).IsCmekEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("CmekKeyVaultUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).CmekKeyVaultUrl = (string) content.GetValueForProperty("CmekKeyVaultUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).CmekKeyVaultUrl, global::System.Convert.ToString); + } + if (content.Contains("CmekEncryptionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).CmekEncryptionStatus = (string) content.GetValueForProperty("CmekEncryptionStatus",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).CmekEncryptionStatus, global::System.Convert.ToString); + } + if (content.Contains("TenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).TenantId, global::System.Convert.ToString); + } + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).PublicNetworkAccess = (string) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).PublicNetworkAccess, global::System.Convert.ToString); + } + if (content.Contains("IsStreamingSupported")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).IsStreamingSupported = (bool?) content.GetValueForProperty("IsStreamingSupported",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).IsStreamingSupported, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsDeveloperAppInsightsApiKeySet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).IsDeveloperAppInsightsApiKeySet = (bool?) content.GetValueForProperty("IsDeveloperAppInsightsApiKeySet",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).IsDeveloperAppInsightsApiKeySet, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MigrationToken")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).MigrationToken = (string) content.GetValueForProperty("MigrationToken",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).MigrationToken, global::System.Convert.ToString); + } + if (content.Contains("DisableLocalAuth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).DisableLocalAuth = (bool?) content.GetValueForProperty("DisableLocalAuth",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).DisableLocalAuth, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SchemaTransformationVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).SchemaTransformationVersion = (string) content.GetValueForProperty("SchemaTransformationVersion",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).SchemaTransformationVersion, global::System.Convert.ToString); + } + if (content.Contains("StorageResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).StorageResourceId = (string) content.GetValueForProperty("StorageResourceId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).StorageResourceId, global::System.Convert.ToString); + } + if (content.Contains("PrivateEndpointConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).PrivateEndpointConnection = (System.Collections.Generic.List) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.PrivateEndpointConnectionTypeConverter.ConvertFrom)); + } + if (content.Contains("OpenWithHint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).OpenWithHint = (string) content.GetValueForProperty("OpenWithHint",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).OpenWithHint, global::System.Convert.ToString); + } + if (content.Contains("AppPasswordHint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).AppPasswordHint = (string) content.GetValueForProperty("AppPasswordHint",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).AppPasswordHint, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("PublishingCredentials")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).PublishingCredentials = (string) content.GetValueForProperty("PublishingCredentials",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).PublishingCredentials, 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 BotProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("IconUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).IconUrl = (string) content.GetValueForProperty("IconUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).IconUrl, global::System.Convert.ToString); + } + if (content.Contains("Endpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).Endpoint = (string) content.GetValueForProperty("Endpoint",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).Endpoint, global::System.Convert.ToString); + } + if (content.Contains("EndpointVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).EndpointVersion = (string) content.GetValueForProperty("EndpointVersion",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).EndpointVersion, global::System.Convert.ToString); + } + if (content.Contains("AllSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).AllSetting = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesAllSettings) content.GetValueForProperty("AllSetting",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).AllSetting, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.BotPropertiesAllSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("Parameter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).Parameter = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesParameters) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).Parameter, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.BotPropertiesParametersTypeConverter.ConvertFrom); + } + if (content.Contains("ManifestUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).ManifestUrl = (string) content.GetValueForProperty("ManifestUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).ManifestUrl, global::System.Convert.ToString); + } + if (content.Contains("MsaAppType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).MsaAppType = (string) content.GetValueForProperty("MsaAppType",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).MsaAppType, global::System.Convert.ToString); + } + if (content.Contains("MsaAppId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).MsaAppId = (string) content.GetValueForProperty("MsaAppId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).MsaAppId, global::System.Convert.ToString); + } + if (content.Contains("MsaAppTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).MsaAppTenantId = (string) content.GetValueForProperty("MsaAppTenantId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).MsaAppTenantId, global::System.Convert.ToString); + } + if (content.Contains("MsaAppMsiResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).MsaAppMsiResourceId = (string) content.GetValueForProperty("MsaAppMsiResourceId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).MsaAppMsiResourceId, global::System.Convert.ToString); + } + if (content.Contains("ConfiguredChannel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).ConfiguredChannel = (System.Collections.Generic.List) content.GetValueForProperty("ConfiguredChannel",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).ConfiguredChannel, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("EnabledChannel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).EnabledChannel = (System.Collections.Generic.List) content.GetValueForProperty("EnabledChannel",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).EnabledChannel, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("DeveloperAppInsightKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).DeveloperAppInsightKey = (string) content.GetValueForProperty("DeveloperAppInsightKey",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).DeveloperAppInsightKey, global::System.Convert.ToString); + } + if (content.Contains("DeveloperAppInsightsApiKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).DeveloperAppInsightsApiKey = (string) content.GetValueForProperty("DeveloperAppInsightsApiKey",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).DeveloperAppInsightsApiKey, global::System.Convert.ToString); + } + if (content.Contains("DeveloperAppInsightsApplicationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).DeveloperAppInsightsApplicationId = (string) content.GetValueForProperty("DeveloperAppInsightsApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).DeveloperAppInsightsApplicationId, global::System.Convert.ToString); + } + if (content.Contains("LuisAppId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).LuisAppId = (System.Collections.Generic.List) content.GetValueForProperty("LuisAppId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).LuisAppId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("LuisKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).LuisKey = (string) content.GetValueForProperty("LuisKey",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).LuisKey, global::System.Convert.ToString); + } + if (content.Contains("IsCmekEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).IsCmekEnabled = (bool?) content.GetValueForProperty("IsCmekEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).IsCmekEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("CmekKeyVaultUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).CmekKeyVaultUrl = (string) content.GetValueForProperty("CmekKeyVaultUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).CmekKeyVaultUrl, global::System.Convert.ToString); + } + if (content.Contains("CmekEncryptionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).CmekEncryptionStatus = (string) content.GetValueForProperty("CmekEncryptionStatus",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).CmekEncryptionStatus, global::System.Convert.ToString); + } + if (content.Contains("TenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).TenantId, global::System.Convert.ToString); + } + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).PublicNetworkAccess = (string) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).PublicNetworkAccess, global::System.Convert.ToString); + } + if (content.Contains("IsStreamingSupported")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).IsStreamingSupported = (bool?) content.GetValueForProperty("IsStreamingSupported",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).IsStreamingSupported, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsDeveloperAppInsightsApiKeySet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).IsDeveloperAppInsightsApiKeySet = (bool?) content.GetValueForProperty("IsDeveloperAppInsightsApiKeySet",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).IsDeveloperAppInsightsApiKeySet, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MigrationToken")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).MigrationToken = (string) content.GetValueForProperty("MigrationToken",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).MigrationToken, global::System.Convert.ToString); + } + if (content.Contains("DisableLocalAuth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).DisableLocalAuth = (bool?) content.GetValueForProperty("DisableLocalAuth",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).DisableLocalAuth, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SchemaTransformationVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).SchemaTransformationVersion = (string) content.GetValueForProperty("SchemaTransformationVersion",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).SchemaTransformationVersion, global::System.Convert.ToString); + } + if (content.Contains("StorageResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).StorageResourceId = (string) content.GetValueForProperty("StorageResourceId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).StorageResourceId, global::System.Convert.ToString); + } + if (content.Contains("PrivateEndpointConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).PrivateEndpointConnection = (System.Collections.Generic.List) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.PrivateEndpointConnectionTypeConverter.ConvertFrom)); + } + if (content.Contains("OpenWithHint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).OpenWithHint = (string) content.GetValueForProperty("OpenWithHint",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).OpenWithHint, global::System.Convert.ToString); + } + if (content.Contains("AppPasswordHint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).AppPasswordHint = (string) content.GetValueForProperty("AppPasswordHint",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).AppPasswordHint, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("PublishingCredentials")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).PublishingCredentials = (string) content.GetValueForProperty("PublishingCredentials",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal)this).PublishingCredentials, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BotProperties(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.BotService.Models.IBotProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BotProperties(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.BotService.Models.IBotProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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 parameters to provide for the Bot. + [System.ComponentModel.TypeConverter(typeof(BotPropertiesTypeConverter))] + public partial interface IBotProperties + + { + + } +} \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotProperties.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/BotProperties.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotProperties.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/BotProperties.TypeConverter.cs index 70554228cda5..d3565460aa0a 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotProperties.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/BotProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IBotProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotProperties.cs b/generated/BotService/BotService.Autorest/generated/api/Models/BotProperties.cs similarity index 81% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotProperties.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/BotProperties.cs index 908ac61f48e3..8f6bb3082143 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotProperties.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/BotProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// The parameters to provide for the Bot. public partial class BotProperties : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotProperties, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotProperties, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesAllSettings _allSetting; + private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesAllSettings _allSetting; /// Contains resource all settings defined as key/value pairs. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesAllSettings AllSetting { get => (this._allSetting = this._allSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.BotPropertiesAllSettings()); set => this._allSetting = value; } + public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesAllSettings AllSetting { get => (this._allSetting = this._allSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.BotPropertiesAllSettings()); set => this._allSetting = value; } /// Backing field for property. private string _appPasswordHint; @@ -42,11 +42,11 @@ public partial class BotProperties : public string CmekKeyVaultUrl { get => this._cmekKeyVaultUrl; set => this._cmekKeyVaultUrl = value; } /// Backing field for property. - private string[] _configuredChannel; + private System.Collections.Generic.List _configuredChannel; /// Collection of channels for which the bot is configured [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Owned)] - public string[] ConfiguredChannel { get => this._configuredChannel; } + public System.Collections.Generic.List ConfiguredChannel { get => this._configuredChannel; } /// Backing field for property. private string _description; @@ -93,11 +93,11 @@ public partial class BotProperties : public string DisplayName { get => this._displayName; set => this._displayName = value; } /// Backing field for property. - private string[] _enabledChannel; + private System.Collections.Generic.List _enabledChannel; /// Collection of channels for which the bot is enabled [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Owned)] - public string[] EnabledChannel { get => this._enabledChannel; } + public System.Collections.Generic.List EnabledChannel { get => this._enabledChannel; } /// Backing field for property. private string _endpoint; @@ -142,11 +142,11 @@ public partial class BotProperties : public bool? IsStreamingSupported { get => this._isStreamingSupported; set => this._isStreamingSupported = value; } /// Backing field for property. - private string[] _luisAppId; + private System.Collections.Generic.List _luisAppId; /// Collection of LUIS App Ids [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Owned)] - public string[] LuisAppId { get => this._luisAppId; set => this._luisAppId = value; } + public System.Collections.Generic.List LuisAppId { get => this._luisAppId; set => this._luisAppId = value; } /// Backing field for property. private string _luisKey; @@ -163,28 +163,28 @@ public partial class BotProperties : public string ManifestUrl { get => this._manifestUrl; set => this._manifestUrl = value; } /// Internal Acessors for CmekEncryptionStatus - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal.CmekEncryptionStatus { get => this._cmekEncryptionStatus; set { {_cmekEncryptionStatus = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal.CmekEncryptionStatus { get => this._cmekEncryptionStatus; set { {_cmekEncryptionStatus = value;} } } /// Internal Acessors for ConfiguredChannel - string[] Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal.ConfiguredChannel { get => this._configuredChannel; set { {_configuredChannel = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal.ConfiguredChannel { get => this._configuredChannel; set { {_configuredChannel = value;} } } /// Internal Acessors for EnabledChannel - string[] Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal.EnabledChannel { get => this._enabledChannel; set { {_enabledChannel = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal.EnabledChannel { get => this._enabledChannel; set { {_enabledChannel = value;} } } /// Internal Acessors for EndpointVersion - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal.EndpointVersion { get => this._endpointVersion; set { {_endpointVersion = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal.EndpointVersion { get => this._endpointVersion; set { {_endpointVersion = value;} } } /// Internal Acessors for IsDeveloperAppInsightsApiKeySet - bool? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal.IsDeveloperAppInsightsApiKeySet { get => this._isDeveloperAppInsightsApiKeySet; set { {_isDeveloperAppInsightsApiKeySet = value;} } } + bool? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal.IsDeveloperAppInsightsApiKeySet { get => this._isDeveloperAppInsightsApiKeySet; set { {_isDeveloperAppInsightsApiKeySet = value;} } } /// Internal Acessors for MigrationToken - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal.MigrationToken { get => this._migrationToken; set { {_migrationToken = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal.MigrationToken { get => this._migrationToken; set { {_migrationToken = value;} } } /// Internal Acessors for PrivateEndpointConnection - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnection[] Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal.PrivateEndpointConnection { get => this._privateEndpointConnection; set { {_privateEndpointConnection = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal.PrivateEndpointConnection { get => this._privateEndpointConnection; set { {_privateEndpointConnection = value;} } } /// Internal Acessors for ProvisioningState - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } /// Backing field for property. private string _migrationToken; @@ -215,11 +215,11 @@ public partial class BotProperties : public string MsaAppTenantId { get => this._msaAppTenantId; set => this._msaAppTenantId = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.MsaAppType? _msaAppType; + private string _msaAppType; /// Microsoft App Type for the bot [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.MsaAppType? MsaAppType { get => this._msaAppType; set => this._msaAppType = value; } + public string MsaAppType { get => this._msaAppType; set => this._msaAppType = value; } /// Backing field for property. private string _openWithHint; @@ -231,18 +231,18 @@ public partial class BotProperties : public string OpenWithHint { get => this._openWithHint; set => this._openWithHint = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesParameters _parameter; + private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesParameters _parameter; /// Contains resource parameters defined as key/value pairs. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesParameters Parameter { get => (this._parameter = this._parameter ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.BotPropertiesParameters()); set => this._parameter = value; } + public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesParameters Parameter { get => (this._parameter = this._parameter ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.BotPropertiesParameters()); set => this._parameter = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnection[] _privateEndpointConnection; + private System.Collections.Generic.List _privateEndpointConnection; /// List of Private Endpoint Connections configured for the bot [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnection[] PrivateEndpointConnection { get => this._privateEndpointConnection; } + public System.Collections.Generic.List PrivateEndpointConnection { get => this._privateEndpointConnection; } /// Backing field for property. private string _provisioningState; @@ -252,11 +252,11 @@ public partial class BotProperties : public string ProvisioningState { get => this._provisioningState; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PublicNetworkAccess? _publicNetworkAccess; + private string _publicNetworkAccess; /// Whether the bot is in an isolated network [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PublicNetworkAccess? PublicNetworkAccess { get => this._publicNetworkAccess; set => this._publicNetworkAccess = value; } + public string PublicNetworkAccess { get => this._publicNetworkAccess; set => this._publicNetworkAccess = value; } /// Backing field for property. private string _publishingCredentials; @@ -300,14 +300,20 @@ public partial interface IBotProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Contains resource all settings defined as key/value pairs.", SerializedName = @"allSettings", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesAllSettings) })] - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesAllSettings AllSetting { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesAllSettings) })] + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesAllSettings AllSetting { get; set; } /// The hint (e.g. keyVault secret resourceId) on how to fetch the app secret [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The hint (e.g. keyVault secret resourceId) on how to fetch the app secret", SerializedName = @"appPasswordHint", PossibleTypes = new [] { typeof(string) })] @@ -316,6 +322,9 @@ public partial interface IBotProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The CMK encryption status", SerializedName = @"cmekEncryptionStatus", PossibleTypes = new [] { typeof(string) })] @@ -324,6 +333,9 @@ public partial interface IBotProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The CMK Url", SerializedName = @"cmekKeyVaultUrl", PossibleTypes = new [] { typeof(string) })] @@ -332,14 +344,20 @@ public partial interface IBotProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Collection of channels for which the bot is configured", SerializedName = @"configuredChannels", PossibleTypes = new [] { typeof(string) })] - string[] ConfiguredChannel { get; } + System.Collections.Generic.List ConfiguredChannel { get; } /// The description of the bot [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The description of the bot", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -348,6 +366,9 @@ public partial interface IBotProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The Application Insights key", SerializedName = @"developerAppInsightKey", PossibleTypes = new [] { typeof(string) })] @@ -356,6 +377,9 @@ public partial interface IBotProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The Application Insights Api Key", SerializedName = @"developerAppInsightsApiKey", PossibleTypes = new [] { typeof(string) })] @@ -364,6 +388,9 @@ public partial interface IBotProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The Application Insights App Id", SerializedName = @"developerAppInsightsApplicationId", PossibleTypes = new [] { typeof(string) })] @@ -374,6 +401,9 @@ public partial interface IBotProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication.", SerializedName = @"disableLocalAuth", PossibleTypes = new [] { typeof(bool) })] @@ -382,6 +412,9 @@ public partial interface IBotProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The Name of the bot", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -390,14 +423,20 @@ public partial interface IBotProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Collection of channels for which the bot is enabled", SerializedName = @"enabledChannels", PossibleTypes = new [] { typeof(string) })] - string[] EnabledChannel { get; } + System.Collections.Generic.List EnabledChannel { get; } /// The bot's endpoint [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The bot's endpoint", SerializedName = @"endpoint", PossibleTypes = new [] { typeof(string) })] @@ -406,6 +445,9 @@ public partial interface IBotProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The bot's endpoint version", SerializedName = @"endpointVersion", PossibleTypes = new [] { typeof(string) })] @@ -414,6 +456,9 @@ public partial interface IBotProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The Icon Url of the bot", SerializedName = @"iconUrl", PossibleTypes = new [] { typeof(string) })] @@ -422,6 +467,9 @@ public partial interface IBotProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Whether Cmek is enabled", SerializedName = @"isCmekEnabled", PossibleTypes = new [] { typeof(bool) })] @@ -430,6 +478,9 @@ public partial interface IBotProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Whether the bot is developerAppInsightsApiKey set", SerializedName = @"isDeveloperAppInsightsApiKeySet", PossibleTypes = new [] { typeof(bool) })] @@ -438,6 +489,9 @@ public partial interface IBotProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Whether the bot is streaming supported", SerializedName = @"isStreamingSupported", PossibleTypes = new [] { typeof(bool) })] @@ -446,14 +500,20 @@ public partial interface IBotProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Collection of LUIS App Ids", SerializedName = @"luisAppIds", PossibleTypes = new [] { typeof(string) })] - string[] LuisAppId { get; set; } + System.Collections.Generic.List LuisAppId { get; set; } /// The LUIS Key [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The LUIS Key", SerializedName = @"luisKey", PossibleTypes = new [] { typeof(string) })] @@ -462,6 +522,9 @@ public partial interface IBotProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The bot's manifest url", SerializedName = @"manifestUrl", PossibleTypes = new [] { typeof(string) })] @@ -470,14 +533,20 @@ public partial interface IBotProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Token used to migrate non Azure bot to azure subscription", SerializedName = @"migrationToken", PossibleTypes = new [] { typeof(string) })] string MigrationToken { get; } /// Microsoft App Id for the bot [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( - Required = true, + Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = false, Description = @"Microsoft App Id for the bot", SerializedName = @"msaAppId", PossibleTypes = new [] { typeof(string) })] @@ -486,6 +555,9 @@ public partial interface IBotProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Microsoft App Managed Identity Resource Id for the bot", SerializedName = @"msaAppMSIResourceId", PossibleTypes = new [] { typeof(string) })] @@ -494,6 +566,9 @@ public partial interface IBotProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = false, Description = @"Microsoft App Tenant Id for the bot", SerializedName = @"msaAppTenantId", PossibleTypes = new [] { typeof(string) })] @@ -502,16 +577,23 @@ public partial interface IBotProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Microsoft App Type for the bot", SerializedName = @"msaAppType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.MsaAppType) })] - Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.MsaAppType? MsaAppType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("UserAssignedMSI", "SingleTenant", "MultiTenant")] + string MsaAppType { get; set; } /// /// The hint to browser (e.g. protocol handler) on how to open the bot for authoring /// [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The hint to browser (e.g. protocol handler) on how to open the bot for authoring", SerializedName = @"openWithHint", PossibleTypes = new [] { typeof(string) })] @@ -520,22 +602,31 @@ public partial interface IBotProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Contains resource parameters defined as key/value pairs.", SerializedName = @"parameters", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesParameters) })] - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesParameters Parameter { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesParameters) })] + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesParameters Parameter { get; set; } /// List of Private Endpoint Connections configured for the bot [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"List of Private Endpoint Connections configured for the bot", SerializedName = @"privateEndpointConnections", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnection) })] - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnection[] PrivateEndpointConnection { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnection) })] + System.Collections.Generic.List PrivateEndpointConnection { get; } /// Provisioning state of the resource [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Provisioning state of the resource", SerializedName = @"provisioningState", PossibleTypes = new [] { typeof(string) })] @@ -544,14 +635,21 @@ public partial interface IBotProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Whether the bot is in an isolated network", SerializedName = @"publicNetworkAccess", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PublicNetworkAccess) })] - Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string PublicNetworkAccess { get; set; } /// Publishing credentials of the resource [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Publishing credentials of the resource", SerializedName = @"publishingCredentials", PossibleTypes = new [] { typeof(string) })] @@ -560,6 +658,9 @@ public partial interface IBotProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The channel schema transformation version for the bot", SerializedName = @"schemaTransformationVersion", PossibleTypes = new [] { typeof(string) })] @@ -568,6 +669,9 @@ public partial interface IBotProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The storage resourceId for the bot", SerializedName = @"storageResourceId", PossibleTypes = new [] { typeof(string) })] @@ -576,6 +680,9 @@ public partial interface IBotProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = false, Description = @"The Tenant Id for the bot", SerializedName = @"tenantId", PossibleTypes = new [] { typeof(string) })] @@ -587,7 +694,7 @@ internal partial interface IBotPropertiesInternal { /// Contains resource all settings defined as key/value pairs. - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesAllSettings AllSetting { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesAllSettings AllSetting { get; set; } /// The hint (e.g. keyVault secret resourceId) on how to fetch the app secret string AppPasswordHint { get; set; } /// The CMK encryption status @@ -595,7 +702,7 @@ internal partial interface IBotPropertiesInternal /// The CMK Url string CmekKeyVaultUrl { get; set; } /// Collection of channels for which the bot is configured - string[] ConfiguredChannel { get; set; } + System.Collections.Generic.List ConfiguredChannel { get; set; } /// The description of the bot string Description { get; set; } /// The Application Insights key @@ -611,7 +718,7 @@ internal partial interface IBotPropertiesInternal /// The Name of the bot string DisplayName { get; set; } /// Collection of channels for which the bot is enabled - string[] EnabledChannel { get; set; } + System.Collections.Generic.List EnabledChannel { get; set; } /// The bot's endpoint string Endpoint { get; set; } /// The bot's endpoint version @@ -625,7 +732,7 @@ internal partial interface IBotPropertiesInternal /// Whether the bot is streaming supported bool? IsStreamingSupported { get; set; } /// Collection of LUIS App Ids - string[] LuisAppId { get; set; } + System.Collections.Generic.List LuisAppId { get; set; } /// The LUIS Key string LuisKey { get; set; } /// The bot's manifest url @@ -639,19 +746,21 @@ internal partial interface IBotPropertiesInternal /// Microsoft App Tenant Id for the bot string MsaAppTenantId { get; set; } /// Microsoft App Type for the bot - Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.MsaAppType? MsaAppType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("UserAssignedMSI", "SingleTenant", "MultiTenant")] + string MsaAppType { get; set; } /// /// The hint to browser (e.g. protocol handler) on how to open the bot for authoring /// string OpenWithHint { get; set; } /// Contains resource parameters defined as key/value pairs. - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesParameters Parameter { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesParameters Parameter { get; set; } /// List of Private Endpoint Connections configured for the bot - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnection[] PrivateEndpointConnection { get; set; } + System.Collections.Generic.List PrivateEndpointConnection { get; set; } /// Provisioning state of the resource string ProvisioningState { get; set; } /// Whether the bot is in an isolated network - Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string PublicNetworkAccess { get; set; } /// Publishing credentials of the resource string PublishingCredentials { get; set; } /// The channel schema transformation version for the bot diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotProperties.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/BotProperties.json.cs similarity index 81% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotProperties.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/BotProperties.json.cs index 1e9c643d3a99..a170f60342b8 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotProperties.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/BotProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -65,52 +65,52 @@ internal BotProperties(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Jso { return; } - {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} - {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} - {_iconUrl = If( json?.PropertyT("iconUrl"), out var __jsonIconUrl) ? (string)__jsonIconUrl : (string)IconUrl;} - {_endpoint = If( json?.PropertyT("endpoint"), out var __jsonEndpoint) ? (string)__jsonEndpoint : (string)Endpoint;} - {_endpointVersion = If( json?.PropertyT("endpointVersion"), out var __jsonEndpointVersion) ? (string)__jsonEndpointVersion : (string)EndpointVersion;} - {_allSetting = If( json?.PropertyT("allSettings"), out var __jsonAllSettings) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.BotPropertiesAllSettings.FromJson(__jsonAllSettings) : AllSetting;} - {_parameter = If( json?.PropertyT("parameters"), out var __jsonParameters) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.BotPropertiesParameters.FromJson(__jsonParameters) : Parameter;} - {_manifestUrl = If( json?.PropertyT("manifestUrl"), out var __jsonManifestUrl) ? (string)__jsonManifestUrl : (string)ManifestUrl;} - {_msaAppType = If( json?.PropertyT("msaAppType"), out var __jsonMsaAppType) ? (string)__jsonMsaAppType : (string)MsaAppType;} - {_msaAppId = If( json?.PropertyT("msaAppId"), out var __jsonMsaAppId) ? (string)__jsonMsaAppId : (string)MsaAppId;} - {_msaAppTenantId = If( json?.PropertyT("msaAppTenantId"), out var __jsonMsaAppTenantId) ? (string)__jsonMsaAppTenantId : (string)MsaAppTenantId;} - {_msaAppMsiResourceId = If( json?.PropertyT("msaAppMSIResourceId"), out var __jsonMsaAppMsiResourceId) ? (string)__jsonMsaAppMsiResourceId : (string)MsaAppMsiResourceId;} - {_configuredChannel = If( json?.PropertyT("configuredChannels"), out var __jsonConfiguredChannels) ? If( __jsonConfiguredChannels as Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : ConfiguredChannel;} - {_enabledChannel = If( json?.PropertyT("enabledChannels"), out var __jsonEnabledChannels) ? If( __jsonEnabledChannels as Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : EnabledChannel;} - {_developerAppInsightKey = If( json?.PropertyT("developerAppInsightKey"), out var __jsonDeveloperAppInsightKey) ? (string)__jsonDeveloperAppInsightKey : (string)DeveloperAppInsightKey;} - {_developerAppInsightsApiKey = If( json?.PropertyT("developerAppInsightsApiKey"), out var __jsonDeveloperAppInsightsApiKey) ? (string)__jsonDeveloperAppInsightsApiKey : (string)DeveloperAppInsightsApiKey;} - {_developerAppInsightsApplicationId = If( json?.PropertyT("developerAppInsightsApplicationId"), out var __jsonDeveloperAppInsightsApplicationId) ? (string)__jsonDeveloperAppInsightsApplicationId : (string)DeveloperAppInsightsApplicationId;} - {_luisAppId = If( json?.PropertyT("luisAppIds"), out var __jsonLuisAppIds) ? If( __jsonLuisAppIds as Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Json.JsonString __j ? (string)(__j.ToString()) : null)) ))() : null : LuisAppId;} - {_luisKey = If( json?.PropertyT("luisKey"), out var __jsonLuisKey) ? (string)__jsonLuisKey : (string)LuisKey;} - {_isCmekEnabled = If( json?.PropertyT("isCmekEnabled"), out var __jsonIsCmekEnabled) ? (bool?)__jsonIsCmekEnabled : IsCmekEnabled;} - {_cmekKeyVaultUrl = If( json?.PropertyT("cmekKeyVaultUrl"), out var __jsonCmekKeyVaultUrl) ? (string)__jsonCmekKeyVaultUrl : (string)CmekKeyVaultUrl;} - {_cmekEncryptionStatus = If( json?.PropertyT("cmekEncryptionStatus"), out var __jsonCmekEncryptionStatus) ? (string)__jsonCmekEncryptionStatus : (string)CmekEncryptionStatus;} - {_tenantId = If( json?.PropertyT("tenantId"), out var __jsonTenantId) ? (string)__jsonTenantId : (string)TenantId;} - {_publicNetworkAccess = If( json?.PropertyT("publicNetworkAccess"), out var __jsonPublicNetworkAccess) ? (string)__jsonPublicNetworkAccess : (string)PublicNetworkAccess;} - {_isStreamingSupported = If( json?.PropertyT("isStreamingSupported"), out var __jsonIsStreamingSupported) ? (bool?)__jsonIsStreamingSupported : IsStreamingSupported;} - {_isDeveloperAppInsightsApiKeySet = If( json?.PropertyT("isDeveloperAppInsightsApiKeySet"), out var __jsonIsDeveloperAppInsightsApiKeySet) ? (bool?)__jsonIsDeveloperAppInsightsApiKeySet : IsDeveloperAppInsightsApiKeySet;} - {_migrationToken = If( json?.PropertyT("migrationToken"), out var __jsonMigrationToken) ? (string)__jsonMigrationToken : (string)MigrationToken;} - {_disableLocalAuth = If( json?.PropertyT("disableLocalAuth"), out var __jsonDisableLocalAuth) ? (bool?)__jsonDisableLocalAuth : DisableLocalAuth;} - {_schemaTransformationVersion = If( json?.PropertyT("schemaTransformationVersion"), out var __jsonSchemaTransformationVersion) ? (string)__jsonSchemaTransformationVersion : (string)SchemaTransformationVersion;} - {_storageResourceId = If( json?.PropertyT("storageResourceId"), out var __jsonStorageResourceId) ? (string)__jsonStorageResourceId : (string)StorageResourceId;} - {_privateEndpointConnection = If( json?.PropertyT("privateEndpointConnections"), out var __jsonPrivateEndpointConnections) ? If( __jsonPrivateEndpointConnections as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonArray, out var __g) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__g, (__f)=>(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnection) (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateEndpointConnection.FromJson(__f) )) ))() : null : PrivateEndpointConnection;} - {_openWithHint = If( json?.PropertyT("openWithHint"), out var __jsonOpenWithHint) ? (string)__jsonOpenWithHint : (string)OpenWithHint;} - {_appPasswordHint = If( json?.PropertyT("appPasswordHint"), out var __jsonAppPasswordHint) ? (string)__jsonAppPasswordHint : (string)AppPasswordHint;} - {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} - {_publishingCredentials = If( json?.PropertyT("publishingCredentials"), out var __jsonPublishingCredentials) ? (string)__jsonPublishingCredentials : (string)PublishingCredentials;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)_displayName;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)_description;} + {_iconUrl = If( json?.PropertyT("iconUrl"), out var __jsonIconUrl) ? (string)__jsonIconUrl : (string)_iconUrl;} + {_endpoint = If( json?.PropertyT("endpoint"), out var __jsonEndpoint) ? (string)__jsonEndpoint : (string)_endpoint;} + {_endpointVersion = If( json?.PropertyT("endpointVersion"), out var __jsonEndpointVersion) ? (string)__jsonEndpointVersion : (string)_endpointVersion;} + {_allSetting = If( json?.PropertyT("allSettings"), out var __jsonAllSettings) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.BotPropertiesAllSettings.FromJson(__jsonAllSettings) : _allSetting;} + {_parameter = If( json?.PropertyT("parameters"), out var __jsonParameters) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.BotPropertiesParameters.FromJson(__jsonParameters) : _parameter;} + {_manifestUrl = If( json?.PropertyT("manifestUrl"), out var __jsonManifestUrl) ? (string)__jsonManifestUrl : (string)_manifestUrl;} + {_msaAppType = If( json?.PropertyT("msaAppType"), out var __jsonMsaAppType) ? (string)__jsonMsaAppType : (string)_msaAppType;} + {_msaAppId = If( json?.PropertyT("msaAppId"), out var __jsonMsaAppId) ? (string)__jsonMsaAppId : (string)_msaAppId;} + {_msaAppTenantId = If( json?.PropertyT("msaAppTenantId"), out var __jsonMsaAppTenantId) ? (string)__jsonMsaAppTenantId : (string)_msaAppTenantId;} + {_msaAppMsiResourceId = If( json?.PropertyT("msaAppMSIResourceId"), out var __jsonMsaAppMsiResourceId) ? (string)__jsonMsaAppMsiResourceId : (string)_msaAppMsiResourceId;} + {_configuredChannel = If( json?.PropertyT("configuredChannels"), out var __jsonConfiguredChannels) ? If( __jsonConfiguredChannels as Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _configuredChannel;} + {_enabledChannel = If( json?.PropertyT("enabledChannels"), out var __jsonEnabledChannels) ? If( __jsonEnabledChannels as Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : _enabledChannel;} + {_developerAppInsightKey = If( json?.PropertyT("developerAppInsightKey"), out var __jsonDeveloperAppInsightKey) ? (string)__jsonDeveloperAppInsightKey : (string)_developerAppInsightKey;} + {_developerAppInsightsApiKey = If( json?.PropertyT("developerAppInsightsApiKey"), out var __jsonDeveloperAppInsightsApiKey) ? (string)__jsonDeveloperAppInsightsApiKey : (string)_developerAppInsightsApiKey;} + {_developerAppInsightsApplicationId = If( json?.PropertyT("developerAppInsightsApplicationId"), out var __jsonDeveloperAppInsightsApplicationId) ? (string)__jsonDeveloperAppInsightsApplicationId : (string)_developerAppInsightsApplicationId;} + {_luisAppId = If( json?.PropertyT("luisAppIds"), out var __jsonLuisAppIds) ? If( __jsonLuisAppIds as Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Json.JsonString __j ? (string)(__j.ToString()) : null)) ))() : null : _luisAppId;} + {_luisKey = If( json?.PropertyT("luisKey"), out var __jsonLuisKey) ? (string)__jsonLuisKey : (string)_luisKey;} + {_isCmekEnabled = If( json?.PropertyT("isCmekEnabled"), out var __jsonIsCmekEnabled) ? (bool?)__jsonIsCmekEnabled : _isCmekEnabled;} + {_cmekKeyVaultUrl = If( json?.PropertyT("cmekKeyVaultUrl"), out var __jsonCmekKeyVaultUrl) ? (string)__jsonCmekKeyVaultUrl : (string)_cmekKeyVaultUrl;} + {_cmekEncryptionStatus = If( json?.PropertyT("cmekEncryptionStatus"), out var __jsonCmekEncryptionStatus) ? (string)__jsonCmekEncryptionStatus : (string)_cmekEncryptionStatus;} + {_tenantId = If( json?.PropertyT("tenantId"), out var __jsonTenantId) ? (string)__jsonTenantId : (string)_tenantId;} + {_publicNetworkAccess = If( json?.PropertyT("publicNetworkAccess"), out var __jsonPublicNetworkAccess) ? (string)__jsonPublicNetworkAccess : (string)_publicNetworkAccess;} + {_isStreamingSupported = If( json?.PropertyT("isStreamingSupported"), out var __jsonIsStreamingSupported) ? (bool?)__jsonIsStreamingSupported : _isStreamingSupported;} + {_isDeveloperAppInsightsApiKeySet = If( json?.PropertyT("isDeveloperAppInsightsApiKeySet"), out var __jsonIsDeveloperAppInsightsApiKeySet) ? (bool?)__jsonIsDeveloperAppInsightsApiKeySet : _isDeveloperAppInsightsApiKeySet;} + {_migrationToken = If( json?.PropertyT("migrationToken"), out var __jsonMigrationToken) ? (string)__jsonMigrationToken : (string)_migrationToken;} + {_disableLocalAuth = If( json?.PropertyT("disableLocalAuth"), out var __jsonDisableLocalAuth) ? (bool?)__jsonDisableLocalAuth : _disableLocalAuth;} + {_schemaTransformationVersion = If( json?.PropertyT("schemaTransformationVersion"), out var __jsonSchemaTransformationVersion) ? (string)__jsonSchemaTransformationVersion : (string)_schemaTransformationVersion;} + {_storageResourceId = If( json?.PropertyT("storageResourceId"), out var __jsonStorageResourceId) ? (string)__jsonStorageResourceId : (string)_storageResourceId;} + {_privateEndpointConnection = If( json?.PropertyT("privateEndpointConnections"), out var __jsonPrivateEndpointConnections) ? If( __jsonPrivateEndpointConnections as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonArray, out var __g) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__g, (__f)=>(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnection) (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.PrivateEndpointConnection.FromJson(__f) )) ))() : null : _privateEndpointConnection;} + {_openWithHint = If( json?.PropertyT("openWithHint"), out var __jsonOpenWithHint) ? (string)__jsonOpenWithHint : (string)_openWithHint;} + {_appPasswordHint = If( json?.PropertyT("appPasswordHint"), out var __jsonAppPasswordHint) ? (string)__jsonAppPasswordHint : (string)_appPasswordHint;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} + {_publishingCredentials = If( json?.PropertyT("publishingCredentials"), out var __jsonPublishingCredentials) ? (string)__jsonPublishingCredentials : (string)_publishingCredentials;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new BotProperties(json) : null; } @@ -138,7 +138,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode ToJso AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); AddIf( null != (((object)this._iconUrl)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._iconUrl.ToString()) : null, "iconUrl" ,container.Add ); AddIf( null != (((object)this._endpoint)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._endpoint.ToString()) : null, "endpoint" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._endpointVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._endpointVersion.ToString()) : null, "endpointVersion" ,container.Add ); } @@ -146,10 +146,16 @@ public Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode ToJso AddIf( null != this._parameter ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) this._parameter.ToJson(null,serializationMode) : null, "parameters" ,container.Add ); AddIf( null != (((object)this._manifestUrl)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._manifestUrl.ToString()) : null, "manifestUrl" ,container.Add ); AddIf( null != (((object)this._msaAppType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._msaAppType.ToString()) : null, "msaAppType" ,container.Add ); - AddIf( null != (((object)this._msaAppId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._msaAppId.ToString()) : null, "msaAppId" ,container.Add ); - AddIf( null != (((object)this._msaAppTenantId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._msaAppTenantId.ToString()) : null, "msaAppTenantId" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._msaAppId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._msaAppId.ToString()) : null, "msaAppId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._msaAppTenantId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._msaAppTenantId.ToString()) : null, "msaAppTenantId" ,container.Add ); + } AddIf( null != (((object)this._msaAppMsiResourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._msaAppMsiResourceId.ToString()) : null, "msaAppMSIResourceId" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)) { if (null != this._configuredChannel) { @@ -161,7 +167,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode ToJso container.Add("configuredChannels",__w); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)) { if (null != this._enabledChannel) { @@ -188,25 +194,28 @@ public Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode ToJso AddIf( null != (((object)this._luisKey)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._luisKey.ToString()) : null, "luisKey" ,container.Add ); AddIf( null != this._isCmekEnabled ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonBoolean((bool)this._isCmekEnabled) : null, "isCmekEnabled" ,container.Add ); AddIf( null != (((object)this._cmekKeyVaultUrl)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._cmekKeyVaultUrl.ToString()) : null, "cmekKeyVaultUrl" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._cmekEncryptionStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._cmekEncryptionStatus.ToString()) : null, "cmekEncryptionStatus" ,container.Add ); } - AddIf( null != (((object)this._tenantId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._tenantId.ToString()) : null, "tenantId" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._tenantId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._tenantId.ToString()) : null, "tenantId" ,container.Add ); + } AddIf( null != (((object)this._publicNetworkAccess)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._publicNetworkAccess.ToString()) : null, "publicNetworkAccess" ,container.Add ); AddIf( null != this._isStreamingSupported ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonBoolean((bool)this._isStreamingSupported) : null, "isStreamingSupported" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._isDeveloperAppInsightsApiKeySet ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonBoolean((bool)this._isDeveloperAppInsightsApiKeySet) : null, "isDeveloperAppInsightsApiKeySet" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._migrationToken)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._migrationToken.ToString()) : null, "migrationToken" ,container.Add ); } AddIf( null != this._disableLocalAuth ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonBoolean((bool)this._disableLocalAuth) : null, "disableLocalAuth" ,container.Add ); AddIf( null != (((object)this._schemaTransformationVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._schemaTransformationVersion.ToString()) : null, "schemaTransformationVersion" ,container.Add ); AddIf( null != (((object)this._storageResourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._storageResourceId.ToString()) : null, "storageResourceId" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)) { if (null != this._privateEndpointConnection) { @@ -220,7 +229,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode ToJso } AddIf( null != (((object)this._openWithHint)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._openWithHint.ToString()) : null, "openWithHint" ,container.Add ); AddIf( null != (((object)this._appPasswordHint)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._appPasswordHint.ToString()) : null, "appPasswordHint" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotPropertiesAllSettings.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/BotPropertiesAllSettings.PowerShell.cs similarity index 80% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotPropertiesAllSettings.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/BotPropertiesAllSettings.PowerShell.cs index 5e85b8ad87b3..b6eab2b0155a 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotPropertiesAllSettings.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/BotPropertiesAllSettings.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,7 +55,15 @@ public partial class BotPropertiesAllSettings 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. @@ -74,7 +82,7 @@ internal BotPropertiesAllSettings(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. @@ -93,29 +101,27 @@ internal BotPropertiesAllSettings(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 . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesAllSettings DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesAllSettings DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new BotPropertiesAllSettings(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.BotService.Models.Api20220615Preview.IBotPropertiesAllSettings DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesAllSettings DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new BotPropertiesAllSettings(content); } @@ -125,12 +131,24 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Pr /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesAllSettings FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesAllSettings FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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(); + } } /// Contains resource all settings defined as key/value pairs. [System.ComponentModel.TypeConverter(typeof(BotPropertiesAllSettingsTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotPropertiesAllSettings.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/BotPropertiesAllSettings.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotPropertiesAllSettings.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/BotPropertiesAllSettings.TypeConverter.cs index 393b34f8e55e..b4395d7d7e9b 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotPropertiesAllSettings.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/BotPropertiesAllSettings.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IBotPropertiesAllSettings ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesAllSettings ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesAllSettings).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesAllSettings).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotPropertiesAllSettings.cs b/generated/BotService/BotService.Autorest/generated/api/Models/BotPropertiesAllSettings.cs similarity index 79% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotPropertiesAllSettings.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/BotPropertiesAllSettings.cs index 207fd1c479b9..31f5c471f03d 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotPropertiesAllSettings.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/BotPropertiesAllSettings.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// Contains resource all settings defined as key/value pairs. public partial class BotPropertiesAllSettings : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesAllSettings, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesAllSettingsInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesAllSettings, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesAllSettingsInternal { /// Creates an new instance. diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotPropertiesAllSettings.dictionary.cs b/generated/BotService/BotService.Autorest/generated/api/Models/BotPropertiesAllSettings.dictionary.cs similarity index 95% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotPropertiesAllSettings.dictionary.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/BotPropertiesAllSettings.dictionary.cs index 64199c8909b0..b6cf487036a8 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotPropertiesAllSettings.dictionary.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/BotPropertiesAllSettings.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.BotPropertiesAllSettings source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.BotPropertiesAllSettings source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotPropertiesAllSettings.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/BotPropertiesAllSettings.json.cs similarity index 94% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotPropertiesAllSettings.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/BotPropertiesAllSettings.json.cs index 72d4a32a2070..fa600bc6788d 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotPropertiesAllSettings.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/BotPropertiesAllSettings.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -71,13 +71,13 @@ internal BotPropertiesAllSettings(Microsoft.Azure.PowerShell.Cmdlets.BotService. } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesAllSettings. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesAllSettings. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesAllSettings. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesAllSettings. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesAllSettings FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesAllSettings FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new BotPropertiesAllSettings(json) : null; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotPropertiesParameters.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/BotPropertiesParameters.PowerShell.cs similarity index 81% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotPropertiesParameters.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/BotPropertiesParameters.PowerShell.cs index 840d307a167b..c0a1918bfcf4 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotPropertiesParameters.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/BotPropertiesParameters.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,7 +55,15 @@ public partial class BotPropertiesParameters 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. @@ -74,7 +82,7 @@ internal BotPropertiesParameters(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. @@ -93,29 +101,27 @@ internal BotPropertiesParameters(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 . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new BotPropertiesParameters(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.BotService.Models.Api20220615Preview.IBotPropertiesParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new BotPropertiesParameters(content); } @@ -125,12 +131,24 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Pr /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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(); + } } /// Contains resource parameters defined as key/value pairs. [System.ComponentModel.TypeConverter(typeof(BotPropertiesParametersTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotPropertiesParameters.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/BotPropertiesParameters.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotPropertiesParameters.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/BotPropertiesParameters.TypeConverter.cs index dbb573160d38..d27a24f901ca 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotPropertiesParameters.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/BotPropertiesParameters.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IBotPropertiesParameters ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesParameters ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesParameters).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesParameters).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotPropertiesParameters.cs b/generated/BotService/BotService.Autorest/generated/api/Models/BotPropertiesParameters.cs similarity index 79% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotPropertiesParameters.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/BotPropertiesParameters.cs index 58e5684452c4..8d3cf4d1d15b 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotPropertiesParameters.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/BotPropertiesParameters.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// Contains resource parameters defined as key/value pairs. public partial class BotPropertiesParameters : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesParameters, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesParametersInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesParameters, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesParametersInternal { /// Creates an new instance. diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotPropertiesParameters.dictionary.cs b/generated/BotService/BotService.Autorest/generated/api/Models/BotPropertiesParameters.dictionary.cs similarity index 95% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotPropertiesParameters.dictionary.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/BotPropertiesParameters.dictionary.cs index c473011fedd2..0c91698b4039 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotPropertiesParameters.dictionary.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/BotPropertiesParameters.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.BotPropertiesParameters source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.BotPropertiesParameters source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotPropertiesParameters.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/BotPropertiesParameters.json.cs similarity index 94% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotPropertiesParameters.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/BotPropertiesParameters.json.cs index fb8a58d4f121..47f6e6a76980 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotPropertiesParameters.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/BotPropertiesParameters.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -71,13 +71,13 @@ internal BotPropertiesParameters(Microsoft.Azure.PowerShell.Cmdlets.BotService.R } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesParameters. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesParameters. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesParameters. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesParameters. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new BotPropertiesParameters(json) : null; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotResponseList.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/BotResponseList.PowerShell.cs similarity index 71% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotResponseList.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/BotResponseList.PowerShell.cs index 2e6f02b104dd..79d4faa90702 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotResponseList.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/BotResponseList.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,7 +55,15 @@ public partial class BotResponseList 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 BotResponseList(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotResponseListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotResponseListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotResponseListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotResponseListInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotResponseListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotResponseListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.BotTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotResponseListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotResponseListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.BotTypeConverter.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. @@ -95,37 +103,37 @@ internal BotResponseList(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotResponseListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotResponseListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotResponseListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotResponseListInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotResponseListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotResponseListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.BotTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotResponseListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotResponseListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.BotTypeConverter.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.BotService.Models.Api20220615Preview.IBotResponseList DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotResponseList DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new BotResponseList(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.BotService.Models.Api20220615Preview.IBotResponseList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotResponseList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new BotResponseList(content); } @@ -135,12 +143,24 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Pr /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotResponseList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotResponseList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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 list of bot service operation response. [System.ComponentModel.TypeConverter(typeof(BotResponseListTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotResponseList.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/BotResponseList.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotResponseList.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/BotResponseList.TypeConverter.cs index faf65b9a952c..534e22567bd2 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotResponseList.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/BotResponseList.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IBotResponseList ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotResponseList ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotResponseList).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotResponseList).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotResponseList.cs b/generated/BotService/BotService.Autorest/generated/api/Models/BotResponseList.cs similarity index 71% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotResponseList.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/BotResponseList.cs index d27e2726d2f7..6602a000916f 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotResponseList.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/BotResponseList.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// The list of bot service operation response. public partial class BotResponseList : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotResponseList, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotResponseListInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotResponseList, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotResponseListInternal { /// Internal Acessors for Value - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot[] Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotResponseListInternal.Value { get => this._value; set { {_value = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotResponseListInternal.Value { get => this._value; set { {_value = value;} } } /// Backing field for property. private string _nextLink; @@ -24,11 +24,11 @@ public partial class BotResponseList : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot[] _value; + private System.Collections.Generic.List _value; /// Gets the list of bot service results and their properties. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot[] Value { get => this._value; } + public System.Collections.Generic.List Value { get => this._value; } /// Creates an new instance. public BotResponseList() @@ -44,6 +44,9 @@ public partial interface IBotResponseList : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The link used to get the next page of bot service resources.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -52,10 +55,13 @@ public partial interface IBotResponseList : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Gets the list of bot service results and their properties.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot) })] - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot[] Value { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot) })] + System.Collections.Generic.List Value { get; } } /// The list of bot service operation response. @@ -65,7 +71,7 @@ internal partial interface IBotResponseListInternal /// The link used to get the next page of bot service resources. string NextLink { get; set; } /// Gets the list of bot service results and their properties. - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotResponseList.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/BotResponseList.json.cs similarity index 89% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotResponseList.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/BotResponseList.json.cs index bdcc66c0b70c..6d38465e24fb 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/BotResponseList.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/BotResponseList.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -65,19 +65,19 @@ internal BotResponseList(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.J { return; } - {_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.BotService.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.BotService.Models.Api20220615Preview.IBot) (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Bot.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.BotService.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.BotService.Models.IBot) (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Bot.FromJson(__u) )) ))() : null : _value;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotResponseList. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotResponseList. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotResponseList. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotResponseList. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotResponseList FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotResponseList FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new BotResponseList(json) : null; } @@ -102,7 +102,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode ToJso return container; } AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)) { if (null != this._value) { diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/BotServiceIdentity.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/BotServiceIdentity.PowerShell.cs index f5781e1df86b..abbb80cd2ed4 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/BotServiceIdentity.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/BotServiceIdentity.PowerShell.cs @@ -53,6 +53,14 @@ public partial class BotServiceIdentity 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 . @@ -67,6 +75,10 @@ internal BotServiceIdentity(global::System.Collections.IDictionary content) return; } // actually deserialize + if (content.Contains("SubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentityInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentityInternal)this).SubscriptionId, global::System.Convert.ToString); + } if (content.Contains("ResourceGroupName")) { ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentityInternal)this).ResourceGroupName = (string) content.GetValueForProperty("ResourceGroupName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentityInternal)this).ResourceGroupName, global::System.Convert.ToString); @@ -75,13 +87,9 @@ internal BotServiceIdentity(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentityInternal)this).ResourceName = (string) content.GetValueForProperty("ResourceName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentityInternal)this).ResourceName, global::System.Convert.ToString); } - if (content.Contains("SubscriptionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentityInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentityInternal)this).SubscriptionId, global::System.Convert.ToString); - } if (content.Contains("ChannelName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentityInternal)this).ChannelName = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.ChannelName?) content.GetValueForProperty("ChannelName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentityInternal)this).ChannelName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.ChannelName.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentityInternal)this).ChannelName = (string) content.GetValueForProperty("ChannelName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentityInternal)this).ChannelName, global::System.Convert.ToString); } if (content.Contains("ConnectionName")) { @@ -112,6 +120,10 @@ internal BotServiceIdentity(global::System.Management.Automation.PSObject conten return; } // actually deserialize + if (content.Contains("SubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentityInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentityInternal)this).SubscriptionId, global::System.Convert.ToString); + } if (content.Contains("ResourceGroupName")) { ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentityInternal)this).ResourceGroupName = (string) content.GetValueForProperty("ResourceGroupName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentityInternal)this).ResourceGroupName, global::System.Convert.ToString); @@ -120,13 +132,9 @@ internal BotServiceIdentity(global::System.Management.Automation.PSObject conten { ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentityInternal)this).ResourceName = (string) content.GetValueForProperty("ResourceName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentityInternal)this).ResourceName, global::System.Convert.ToString); } - if (content.Contains("SubscriptionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentityInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentityInternal)this).SubscriptionId, global::System.Convert.ToString); - } if (content.Contains("ChannelName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentityInternal)this).ChannelName = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.ChannelName?) content.GetValueForProperty("ChannelName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentityInternal)this).ChannelName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.ChannelName.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentityInternal)this).ChannelName = (string) content.GetValueForProperty("ChannelName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentityInternal)this).ChannelName, global::System.Convert.ToString); } if (content.Contains("ConnectionName")) { @@ -180,6 +188,18 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceId /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.BotService.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(BotServiceIdentityTypeConverter))] public partial interface IBotServiceIdentity diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/BotServiceIdentity.cs b/generated/BotService/BotService.Autorest/generated/api/Models/BotServiceIdentity.cs index abbd7417b7c6..7c2e3bd76682 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/BotServiceIdentity.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/BotServiceIdentity.cs @@ -13,11 +13,11 @@ public partial class BotServiceIdentity : { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.ChannelName? _channelName; + private string _channelName; /// The name of the Channel resource. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.ChannelName? ChannelName { get => this._channelName; set => this._channelName = value; } + public string ChannelName { get => this._channelName; set => this._channelName = value; } /// Backing field for property. private string _connectionName; @@ -74,14 +74,21 @@ public partial interface IBotServiceIdentity : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the Channel resource.", SerializedName = @"channelName", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.ChannelName) })] - Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.ChannelName? ChannelName { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("AlexaChannel", "FacebookChannel", "EmailChannel", "KikChannel", "TelegramChannel", "SlackChannel", "MsTeamsChannel", "SkypeChannel", "WebChatChannel", "DirectLineChannel", "SmsChannel", "LineChannel", "DirectLineSpeechChannel", "OutlookChannel", "Omnichannel", "TelephonyChannel")] + string ChannelName { get; set; } /// The name of the Bot Service Connection Setting resource. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the Bot Service Connection Setting resource.", SerializedName = @"connectionName", PossibleTypes = new [] { typeof(string) })] @@ -90,6 +97,9 @@ public partial interface IBotServiceIdentity : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Resource identity path", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -98,6 +108,9 @@ public partial interface IBotServiceIdentity : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the private endpoint connection associated with the Azure resource", SerializedName = @"privateEndpointConnectionName", PossibleTypes = new [] { typeof(string) })] @@ -106,6 +119,9 @@ public partial interface IBotServiceIdentity : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the Bot resource group in the user subscription.", SerializedName = @"resourceGroupName", PossibleTypes = new [] { typeof(string) })] @@ -114,6 +130,9 @@ public partial interface IBotServiceIdentity : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the Bot resource.", SerializedName = @"resourceName", PossibleTypes = new [] { typeof(string) })] @@ -122,6 +141,9 @@ public partial interface IBotServiceIdentity : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Azure Subscription ID.", SerializedName = @"subscriptionId", PossibleTypes = new [] { typeof(string) })] @@ -132,7 +154,8 @@ internal partial interface IBotServiceIdentityInternal { /// The name of the Channel resource. - Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.ChannelName? ChannelName { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("AlexaChannel", "FacebookChannel", "EmailChannel", "KikChannel", "TelegramChannel", "SlackChannel", "MsTeamsChannel", "SkypeChannel", "WebChatChannel", "DirectLineChannel", "SmsChannel", "LineChannel", "DirectLineSpeechChannel", "OutlookChannel", "Omnichannel", "TelephonyChannel")] + string ChannelName { get; set; } /// The name of the Bot Service Connection Setting resource. string ConnectionName { get; set; } /// Resource identity path diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/BotServiceIdentity.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/BotServiceIdentity.json.cs index 43355fea751d..5239bbfbc3a8 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/BotServiceIdentity.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/BotServiceIdentity.json.cs @@ -64,13 +64,13 @@ internal BotServiceIdentity(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtim { return; } - {_resourceGroupName = If( json?.PropertyT("resourceGroupName"), out var __jsonResourceGroupName) ? (string)__jsonResourceGroupName : (string)ResourceGroupName;} - {_resourceName = If( json?.PropertyT("resourceName"), out var __jsonResourceName) ? (string)__jsonResourceName : (string)ResourceName;} - {_subscriptionId = If( json?.PropertyT("subscriptionId"), out var __jsonSubscriptionId) ? (string)__jsonSubscriptionId : (string)SubscriptionId;} - {_channelName = If( json?.PropertyT("channelName"), out var __jsonChannelName) ? (string)__jsonChannelName : (string)ChannelName;} - {_connectionName = If( json?.PropertyT("connectionName"), out var __jsonConnectionName) ? (string)__jsonConnectionName : (string)ConnectionName;} - {_privateEndpointConnectionName = If( json?.PropertyT("privateEndpointConnectionName"), out var __jsonPrivateEndpointConnectionName) ? (string)__jsonPrivateEndpointConnectionName : (string)PrivateEndpointConnectionName;} - {_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;} + {_resourceName = If( json?.PropertyT("resourceName"), out var __jsonResourceName) ? (string)__jsonResourceName : (string)_resourceName;} + {_channelName = If( json?.PropertyT("channelName"), out var __jsonChannelName) ? (string)__jsonChannelName : (string)_channelName;} + {_connectionName = If( json?.PropertyT("connectionName"), out var __jsonConnectionName) ? (string)__jsonConnectionName : (string)_connectionName;} + {_privateEndpointConnectionName = If( json?.PropertyT("privateEndpointConnectionName"), out var __jsonPrivateEndpointConnectionName) ? (string)__jsonPrivateEndpointConnectionName : (string)_privateEndpointConnectionName;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} AfterFromJson(json); } @@ -105,9 +105,9 @@ public Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode ToJso { return container; } + AddIf( null != (((object)this._subscriptionId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._subscriptionId.ToString()) : null, "subscriptionId" ,container.Add ); AddIf( null != (((object)this._resourceGroupName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._resourceGroupName.ToString()) : null, "resourceGroupName" ,container.Add ); AddIf( null != (((object)this._resourceName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._resourceName.ToString()) : null, "resourceName" ,container.Add ); - AddIf( null != (((object)this._subscriptionId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._subscriptionId.ToString()) : null, "subscriptionId" ,container.Add ); AddIf( null != (((object)this._channelName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._channelName.ToString()) : null, "channelName" ,container.Add ); AddIf( null != (((object)this._connectionName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._connectionName.ToString()) : null, "connectionName" ,container.Add ); AddIf( null != (((object)this._privateEndpointConnectionName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._privateEndpointConnectionName.ToString()) : null, "privateEndpointConnectionName" ,container.Add ); diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Channel.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/Channel.PowerShell.cs similarity index 70% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Channel.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/Channel.PowerShell.cs index de23c9804e73..3eb66799d43d 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Channel.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/Channel.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,7 +55,15 @@ public partial class Channel 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,25 +78,25 @@ internal Channel(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Etag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Etag, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Etag, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).ProvisioningState, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Location, 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,45 +111,45 @@ internal Channel(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Etag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Etag, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Etag, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).ProvisioningState, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Location, 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.BotService.Models.Api20220615Preview.IChannel DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannel DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new Channel(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.BotService.Models.Api20220615Preview.IChannel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new Channel(content); } @@ -151,12 +159,24 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Pr /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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(); + } } /// Channel definition [System.ComponentModel.TypeConverter(typeof(ChannelTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Channel.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/Channel.TypeConverter.cs similarity index 97% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Channel.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/Channel.TypeConverter.cs index 325b17e4dc09..7ec656925b46 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Channel.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/Channel.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IChannel ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannel ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannel).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannel).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Channel.cs b/generated/BotService/BotService.Autorest/generated/api/Models/Channel.cs similarity index 88% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Channel.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/Channel.cs index b883362a6506..2cc7693e4101 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Channel.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/Channel.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// Channel definition public partial class Channel : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannel, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannel, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal { /// Backing field for property. @@ -28,7 +28,7 @@ public partial class Channel : public string Location { get => this._location; set => this._location = value; } /// Internal Acessors for ProvisioningState - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } /// Backing field for property. private string _name; @@ -58,6 +58,9 @@ public partial interface IChannel : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Entity Tag of the resource", SerializedName = @"etag", PossibleTypes = new [] { typeof(string) })] @@ -66,6 +69,9 @@ public partial interface IChannel : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Specifies the location of the resource.", SerializedName = @"location", PossibleTypes = new [] { typeof(string) })] @@ -74,6 +80,9 @@ public partial interface IChannel : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The channel name", SerializedName = @"channelName", PossibleTypes = new [] { typeof(string) })] @@ -82,6 +91,9 @@ public partial interface IChannel : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Provisioning state of the resource", SerializedName = @"provisioningState", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Channel.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/Channel.json.cs similarity index 91% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Channel.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/Channel.json.cs index 29eeaf8bd81a..66630cf3a310 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Channel.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/Channel.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -65,23 +65,21 @@ internal Channel(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.Json { return; } - {_name = If( json?.PropertyT("channelName"), out var __jsonChannelName) ? (string)__jsonChannelName : (string)Name;} - {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? (string)__jsonEtag : (string)Etag;} - {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} - {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)Location;} + {_name = If( json?.PropertyT("channelName"), out var __jsonChannelName) ? (string)__jsonChannelName : (string)_name;} + {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? (string)__jsonEtag : (string)_etag;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} + {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)_location;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannel. - /// Note: the Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannel 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.BotService.Models.IChannel. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannel 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.BotService.Models.Api20220615Preview.IChannel. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannel FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannel. + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannel FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { if (!(node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json)) { @@ -172,7 +170,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode ToJso } AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._name.ToString()) : null, "channelName" ,container.Add ); AddIf( null != (((object)this._etag)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._etag.ToString()) : null, "etag" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ChannelResponseList.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/ChannelResponseList.PowerShell.cs similarity index 70% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ChannelResponseList.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/ChannelResponseList.PowerShell.cs index fca19c8d4bd0..08c39afedaa5 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ChannelResponseList.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/ChannelResponseList.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,7 +55,15 @@ public partial class ChannelResponseList 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 ChannelResponseList(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelResponseListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelResponseListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelResponseListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelResponseListInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelResponseListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannel[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelResponseListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.BotChannelTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelResponseListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelResponseListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.BotChannelTypeConverter.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. @@ -95,39 +103,37 @@ internal ChannelResponseList(global::System.Management.Automation.PSObject conte // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelResponseListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelResponseListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelResponseListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelResponseListInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelResponseListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannel[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelResponseListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.BotChannelTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelResponseListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelResponseListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.BotChannelTypeConverter.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.BotService.Models.Api20220615Preview.IChannelResponseList DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelResponseList DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ChannelResponseList(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.BotService.Models.Api20220615Preview.IChannelResponseList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelResponseList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ChannelResponseList(content); } @@ -137,12 +143,24 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Pr /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelResponseList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelResponseList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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 list of bot service channel operation response. [System.ComponentModel.TypeConverter(typeof(ChannelResponseListTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ChannelResponseList.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/ChannelResponseList.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ChannelResponseList.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/ChannelResponseList.TypeConverter.cs index 759b99886266..51ce2f473242 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ChannelResponseList.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/ChannelResponseList.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IChannelResponseList ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelResponseList ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelResponseList).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelResponseList).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ChannelResponseList.cs b/generated/BotService/BotService.Autorest/generated/api/Models/ChannelResponseList.cs similarity index 71% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ChannelResponseList.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/ChannelResponseList.cs index fbb808834740..82f5c8315c5a 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ChannelResponseList.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/ChannelResponseList.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// The list of bot service channel operation response. public partial class ChannelResponseList : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelResponseList, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelResponseListInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelResponseList, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelResponseListInternal { /// Internal Acessors for Value - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannel[] Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelResponseListInternal.Value { get => this._value; set { {_value = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelResponseListInternal.Value { get => this._value; set { {_value = value;} } } /// Backing field for property. private string _nextLink; @@ -24,11 +24,11 @@ public partial class ChannelResponseList : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannel[] _value; + private System.Collections.Generic.List _value; /// Gets the list of bot service channel results and their properties. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannel[] Value { get => this._value; } + public System.Collections.Generic.List Value { get => this._value; } /// Creates an new instance. public ChannelResponseList() @@ -44,6 +44,9 @@ public partial interface IChannelResponseList : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The link used to get the next page of bot service channel resources.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -52,10 +55,13 @@ public partial interface IChannelResponseList : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Gets the list of bot service channel results and their properties.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannel) })] - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannel[] Value { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannel) })] + System.Collections.Generic.List Value { get; } } /// The list of bot service channel operation response. @@ -65,7 +71,7 @@ internal partial interface IChannelResponseListInternal /// The link used to get the next page of bot service channel resources. string NextLink { get; set; } /// Gets the list of bot service channel results and their properties. - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannel[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ChannelResponseList.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/ChannelResponseList.json.cs similarity index 88% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ChannelResponseList.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/ChannelResponseList.json.cs index ce52334260ca..3efb97427c5a 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ChannelResponseList.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/ChannelResponseList.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -65,19 +65,19 @@ internal ChannelResponseList(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runti { return; } - {_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.BotService.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.BotService.Models.Api20220615Preview.IBotChannel) (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.BotChannel.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.BotService.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.BotService.Models.IBotChannel) (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.BotChannel.FromJson(__u) )) ))() : null : _value;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelResponseList. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelResponseList. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelResponseList. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelResponseList. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelResponseList FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelResponseList FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new ChannelResponseList(json) : null; } @@ -102,7 +102,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode ToJso return container; } AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)) { if (null != this._value) { diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ChannelSettings.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/ChannelSettings.PowerShell.cs similarity index 58% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ChannelSettings.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/ChannelSettings.PowerShell.cs index a3ffa6791eed..7a1e0201dbb4 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ChannelSettings.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/ChannelSettings.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,7 +55,15 @@ public partial class ChannelSettings 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,45 +78,45 @@ internal ChannelSettings(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("ExtensionKey1")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettingsInternal)this).ExtensionKey1 = (string) content.GetValueForProperty("ExtensionKey1",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettingsInternal)this).ExtensionKey1, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettingsInternal)this).ExtensionKey1 = (string) content.GetValueForProperty("ExtensionKey1",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettingsInternal)this).ExtensionKey1, global::System.Convert.ToString); } if (content.Contains("ExtensionKey2")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettingsInternal)this).ExtensionKey2 = (string) content.GetValueForProperty("ExtensionKey2",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettingsInternal)this).ExtensionKey2, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettingsInternal)this).ExtensionKey2 = (string) content.GetValueForProperty("ExtensionKey2",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettingsInternal)this).ExtensionKey2, global::System.Convert.ToString); } if (content.Contains("Site")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettingsInternal)this).Site = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISite[]) content.GetValueForProperty("Site",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettingsInternal)this).Site, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SiteTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettingsInternal)this).Site = (System.Collections.Generic.List) content.GetValueForProperty("Site",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettingsInternal)this).Site, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.SiteTypeConverter.ConvertFrom)); } if (content.Contains("ChannelId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettingsInternal)this).ChannelId = (string) content.GetValueForProperty("ChannelId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettingsInternal)this).ChannelId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettingsInternal)this).ChannelId = (string) content.GetValueForProperty("ChannelId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettingsInternal)this).ChannelId, global::System.Convert.ToString); } if (content.Contains("ChannelDisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettingsInternal)this).ChannelDisplayName = (string) content.GetValueForProperty("ChannelDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettingsInternal)this).ChannelDisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettingsInternal)this).ChannelDisplayName = (string) content.GetValueForProperty("ChannelDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettingsInternal)this).ChannelDisplayName, global::System.Convert.ToString); } if (content.Contains("BotId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettingsInternal)this).BotId = (string) content.GetValueForProperty("BotId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettingsInternal)this).BotId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettingsInternal)this).BotId = (string) content.GetValueForProperty("BotId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettingsInternal)this).BotId, global::System.Convert.ToString); } if (content.Contains("BotIconUrl")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettingsInternal)this).BotIconUrl = (string) content.GetValueForProperty("BotIconUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettingsInternal)this).BotIconUrl, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettingsInternal)this).BotIconUrl = (string) content.GetValueForProperty("BotIconUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettingsInternal)this).BotIconUrl, global::System.Convert.ToString); } if (content.Contains("IsEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettingsInternal)this).IsEnabled = (bool?) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettingsInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettingsInternal)this).IsEnabled = (bool?) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettingsInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("DisableLocalAuth")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettingsInternal)this).DisableLocalAuth = (bool?) content.GetValueForProperty("DisableLocalAuth",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettingsInternal)this).DisableLocalAuth, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettingsInternal)this).DisableLocalAuth = (bool?) content.GetValueForProperty("DisableLocalAuth",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettingsInternal)this).DisableLocalAuth, (__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. @@ -123,65 +131,65 @@ internal ChannelSettings(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("ExtensionKey1")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettingsInternal)this).ExtensionKey1 = (string) content.GetValueForProperty("ExtensionKey1",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettingsInternal)this).ExtensionKey1, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettingsInternal)this).ExtensionKey1 = (string) content.GetValueForProperty("ExtensionKey1",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettingsInternal)this).ExtensionKey1, global::System.Convert.ToString); } if (content.Contains("ExtensionKey2")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettingsInternal)this).ExtensionKey2 = (string) content.GetValueForProperty("ExtensionKey2",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettingsInternal)this).ExtensionKey2, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettingsInternal)this).ExtensionKey2 = (string) content.GetValueForProperty("ExtensionKey2",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettingsInternal)this).ExtensionKey2, global::System.Convert.ToString); } if (content.Contains("Site")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettingsInternal)this).Site = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISite[]) content.GetValueForProperty("Site",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettingsInternal)this).Site, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SiteTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettingsInternal)this).Site = (System.Collections.Generic.List) content.GetValueForProperty("Site",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettingsInternal)this).Site, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.SiteTypeConverter.ConvertFrom)); } if (content.Contains("ChannelId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettingsInternal)this).ChannelId = (string) content.GetValueForProperty("ChannelId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettingsInternal)this).ChannelId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettingsInternal)this).ChannelId = (string) content.GetValueForProperty("ChannelId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettingsInternal)this).ChannelId, global::System.Convert.ToString); } if (content.Contains("ChannelDisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettingsInternal)this).ChannelDisplayName = (string) content.GetValueForProperty("ChannelDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettingsInternal)this).ChannelDisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettingsInternal)this).ChannelDisplayName = (string) content.GetValueForProperty("ChannelDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettingsInternal)this).ChannelDisplayName, global::System.Convert.ToString); } if (content.Contains("BotId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettingsInternal)this).BotId = (string) content.GetValueForProperty("BotId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettingsInternal)this).BotId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettingsInternal)this).BotId = (string) content.GetValueForProperty("BotId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettingsInternal)this).BotId, global::System.Convert.ToString); } if (content.Contains("BotIconUrl")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettingsInternal)this).BotIconUrl = (string) content.GetValueForProperty("BotIconUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettingsInternal)this).BotIconUrl, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettingsInternal)this).BotIconUrl = (string) content.GetValueForProperty("BotIconUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettingsInternal)this).BotIconUrl, global::System.Convert.ToString); } if (content.Contains("IsEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettingsInternal)this).IsEnabled = (bool?) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettingsInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettingsInternal)this).IsEnabled = (bool?) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettingsInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("DisableLocalAuth")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettingsInternal)this).DisableLocalAuth = (bool?) content.GetValueForProperty("DisableLocalAuth",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettingsInternal)this).DisableLocalAuth, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettingsInternal)this).DisableLocalAuth = (bool?) content.GetValueForProperty("DisableLocalAuth",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettingsInternal)this).DisableLocalAuth, (__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.BotService.Models.Api20220615Preview.IChannelSettings DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettings DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ChannelSettings(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.BotService.Models.Api20220615Preview.IChannelSettings DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettings DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ChannelSettings(content); } @@ -191,12 +199,24 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Pr /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettings FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettings FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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(); + } } /// Channel settings definition [System.ComponentModel.TypeConverter(typeof(ChannelSettingsTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ChannelSettings.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/ChannelSettings.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ChannelSettings.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/ChannelSettings.TypeConverter.cs index 5ab70513b79f..2e10ab4d64dd 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ChannelSettings.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/ChannelSettings.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IChannelSettings ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettings ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettings).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettings).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ChannelSettings.cs b/generated/BotService/BotService.Autorest/generated/api/Models/ChannelSettings.cs similarity index 84% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ChannelSettings.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/ChannelSettings.cs index fd6d8056fde6..b8580d39d73f 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ChannelSettings.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/ChannelSettings.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// Channel settings definition public partial class ChannelSettings : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettings, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettingsInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettings, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettingsInternal { /// Backing field for property. @@ -72,17 +72,17 @@ public partial class ChannelSettings : public bool? IsEnabled { get => this._isEnabled; set => this._isEnabled = value; } /// Internal Acessors for ExtensionKey1 - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettingsInternal.ExtensionKey1 { get => this._extensionKey1; set { {_extensionKey1 = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettingsInternal.ExtensionKey1 { get => this._extensionKey1; set { {_extensionKey1 = value;} } } /// Internal Acessors for ExtensionKey2 - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettingsInternal.ExtensionKey2 { get => this._extensionKey2; set { {_extensionKey2 = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettingsInternal.ExtensionKey2 { get => this._extensionKey2; set { {_extensionKey2 = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISite[] _site; + private System.Collections.Generic.List _site; /// The list of sites [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISite[] Site { get => this._site; set => this._site = value; } + public System.Collections.Generic.List Site { get => this._site; set => this._site = value; } /// Creates an new instance. public ChannelSettings() @@ -98,6 +98,9 @@ public partial interface IChannelSettings : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The bot icon url", SerializedName = @"botIconUrl", PossibleTypes = new [] { typeof(string) })] @@ -106,6 +109,9 @@ public partial interface IChannelSettings : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The bot id", SerializedName = @"botId", PossibleTypes = new [] { typeof(string) })] @@ -114,6 +120,9 @@ public partial interface IChannelSettings : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The channel display name", SerializedName = @"channelDisplayName", PossibleTypes = new [] { typeof(string) })] @@ -122,6 +131,9 @@ public partial interface IChannelSettings : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The channel id", SerializedName = @"channelId", PossibleTypes = new [] { typeof(string) })] @@ -132,6 +144,9 @@ public partial interface IChannelSettings : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication.", SerializedName = @"disableLocalAuth", PossibleTypes = new [] { typeof(bool) })] @@ -140,6 +155,9 @@ public partial interface IChannelSettings : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The extensionKey1", SerializedName = @"extensionKey1", PossibleTypes = new [] { typeof(string) })] @@ -148,6 +166,9 @@ public partial interface IChannelSettings : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The extensionKey2", SerializedName = @"extensionKey2", PossibleTypes = new [] { typeof(string) })] @@ -156,6 +177,9 @@ public partial interface IChannelSettings : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Whether this channel is enabled for the bot", SerializedName = @"isEnabled", PossibleTypes = new [] { typeof(bool) })] @@ -164,10 +188,13 @@ public partial interface IChannelSettings : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of sites", SerializedName = @"sites", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISite) })] - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISite[] Site { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISite) })] + System.Collections.Generic.List Site { get; set; } } /// Channel settings definition @@ -193,7 +220,7 @@ internal partial interface IChannelSettingsInternal /// Whether this channel is enabled for the bot bool? IsEnabled { get; set; } /// The list of sites - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISite[] Site { get; set; } + System.Collections.Generic.List Site { get; set; } } } \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ChannelSettings.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/ChannelSettings.json.cs similarity index 89% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ChannelSettings.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/ChannelSettings.json.cs index 52ec40f3de6a..0c85907864fb 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ChannelSettings.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/ChannelSettings.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -65,26 +65,26 @@ internal ChannelSettings(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.J { return; } - {_extensionKey1 = If( json?.PropertyT("extensionKey1"), out var __jsonExtensionKey1) ? (string)__jsonExtensionKey1 : (string)ExtensionKey1;} - {_extensionKey2 = If( json?.PropertyT("extensionKey2"), out var __jsonExtensionKey2) ? (string)__jsonExtensionKey2 : (string)ExtensionKey2;} - {_site = If( json?.PropertyT("sites"), out var __jsonSites) ? If( __jsonSites as Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.ISite) (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Site.FromJson(__u) )) ))() : null : Site;} - {_channelId = If( json?.PropertyT("channelId"), out var __jsonChannelId) ? (string)__jsonChannelId : (string)ChannelId;} - {_channelDisplayName = If( json?.PropertyT("channelDisplayName"), out var __jsonChannelDisplayName) ? (string)__jsonChannelDisplayName : (string)ChannelDisplayName;} - {_botId = If( json?.PropertyT("botId"), out var __jsonBotId) ? (string)__jsonBotId : (string)BotId;} - {_botIconUrl = If( json?.PropertyT("botIconUrl"), out var __jsonBotIconUrl) ? (string)__jsonBotIconUrl : (string)BotIconUrl;} - {_isEnabled = If( json?.PropertyT("isEnabled"), out var __jsonIsEnabled) ? (bool?)__jsonIsEnabled : IsEnabled;} - {_disableLocalAuth = If( json?.PropertyT("disableLocalAuth"), out var __jsonDisableLocalAuth) ? (bool?)__jsonDisableLocalAuth : DisableLocalAuth;} + {_extensionKey1 = If( json?.PropertyT("extensionKey1"), out var __jsonExtensionKey1) ? (string)__jsonExtensionKey1 : (string)_extensionKey1;} + {_extensionKey2 = If( json?.PropertyT("extensionKey2"), out var __jsonExtensionKey2) ? (string)__jsonExtensionKey2 : (string)_extensionKey2;} + {_site = If( json?.PropertyT("sites"), out var __jsonSites) ? If( __jsonSites as Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.ISite) (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Site.FromJson(__u) )) ))() : null : _site;} + {_channelId = If( json?.PropertyT("channelId"), out var __jsonChannelId) ? (string)__jsonChannelId : (string)_channelId;} + {_channelDisplayName = If( json?.PropertyT("channelDisplayName"), out var __jsonChannelDisplayName) ? (string)__jsonChannelDisplayName : (string)_channelDisplayName;} + {_botId = If( json?.PropertyT("botId"), out var __jsonBotId) ? (string)__jsonBotId : (string)_botId;} + {_botIconUrl = If( json?.PropertyT("botIconUrl"), out var __jsonBotIconUrl) ? (string)__jsonBotIconUrl : (string)_botIconUrl;} + {_isEnabled = If( json?.PropertyT("isEnabled"), out var __jsonIsEnabled) ? (bool?)__jsonIsEnabled : _isEnabled;} + {_disableLocalAuth = If( json?.PropertyT("disableLocalAuth"), out var __jsonDisableLocalAuth) ? (bool?)__jsonDisableLocalAuth : _disableLocalAuth;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettings. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettings. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettings. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettings. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettings FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettings FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new ChannelSettings(json) : null; } @@ -108,11 +108,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode ToJso { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._extensionKey1)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._extensionKey1.ToString()) : null, "extensionKey1" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._extensionKey2)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._extensionKey2.ToString()) : null, "extensionKey2" ,container.Add ); } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/CheckNameAvailabilityRequestBody.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/CheckNameAvailabilityRequestBody.PowerShell.cs similarity index 73% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/CheckNameAvailabilityRequestBody.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/CheckNameAvailabilityRequestBody.PowerShell.cs index 701ec115e2dd..ef1c2e796384 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/CheckNameAvailabilityRequestBody.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/CheckNameAvailabilityRequestBody.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -57,7 +57,15 @@ public partial class CheckNameAvailabilityRequestBody 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. @@ -72,17 +80,17 @@ internal CheckNameAvailabilityRequestBody(global::System.Collections.IDictionary // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICheckNameAvailabilityRequestBodyInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICheckNameAvailabilityRequestBodyInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityRequestBodyInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityRequestBodyInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICheckNameAvailabilityRequestBodyInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICheckNameAvailabilityRequestBodyInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityRequestBodyInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityRequestBodyInternal)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. @@ -97,39 +105,37 @@ internal CheckNameAvailabilityRequestBody(global::System.Management.Automation.P // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICheckNameAvailabilityRequestBodyInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICheckNameAvailabilityRequestBodyInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityRequestBodyInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityRequestBodyInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICheckNameAvailabilityRequestBodyInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICheckNameAvailabilityRequestBodyInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityRequestBodyInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityRequestBodyInternal)this).Type, 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.BotService.Models.Api20220615Preview.ICheckNameAvailabilityRequestBody DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityRequestBody DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new CheckNameAvailabilityRequestBody(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.BotService.Models.Api20220615Preview.ICheckNameAvailabilityRequestBody DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityRequestBody DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new CheckNameAvailabilityRequestBody(content); } @@ -139,12 +145,24 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Pr /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICheckNameAvailabilityRequestBody FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityRequestBody FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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 request body for a request to Bot Service Management to check availability of a bot name. [System.ComponentModel.TypeConverter(typeof(CheckNameAvailabilityRequestBodyTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/CheckNameAvailabilityRequestBody.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/CheckNameAvailabilityRequestBody.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/CheckNameAvailabilityRequestBody.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/CheckNameAvailabilityRequestBody.TypeConverter.cs index 6d7e0c64cc5b..a392cbfb6d26 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/CheckNameAvailabilityRequestBody.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/CheckNameAvailabilityRequestBody.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.ICheckNameAvailabilityRequestBody ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityRequestBody ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICheckNameAvailabilityRequestBody).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityRequestBody).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/CheckNameAvailabilityRequestBody.cs b/generated/BotService/BotService.Autorest/generated/api/Models/CheckNameAvailabilityRequestBody.cs similarity index 88% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/CheckNameAvailabilityRequestBody.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/CheckNameAvailabilityRequestBody.cs index 3f261825bb40..ebd057beecda 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/CheckNameAvailabilityRequestBody.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/CheckNameAvailabilityRequestBody.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -11,8 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Previe /// The request body for a request to Bot Service Management to check availability of a bot name. /// public partial class CheckNameAvailabilityRequestBody : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICheckNameAvailabilityRequestBody, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICheckNameAvailabilityRequestBodyInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityRequestBody, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityRequestBodyInternal { /// Backing field for property. @@ -43,6 +43,9 @@ public partial interface ICheckNameAvailabilityRequestBody : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the name of the bot for which availability needs to be checked.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -51,6 +54,9 @@ public partial interface ICheckNameAvailabilityRequestBody : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the type of the bot for which availability needs to be checked", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/CheckNameAvailabilityRequestBody.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/CheckNameAvailabilityRequestBody.json.cs similarity index 93% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/CheckNameAvailabilityRequestBody.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/CheckNameAvailabilityRequestBody.json.cs index be8616b65da4..b484a0c8f6ef 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/CheckNameAvailabilityRequestBody.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/CheckNameAvailabilityRequestBody.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -67,19 +67,19 @@ internal CheckNameAvailabilityRequestBody(Microsoft.Azure.PowerShell.Cmdlets.Bot { return; } - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_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.BotService.Models.Api20220615Preview.ICheckNameAvailabilityRequestBody. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityRequestBody. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICheckNameAvailabilityRequestBody. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityRequestBody. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICheckNameAvailabilityRequestBody FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityRequestBody FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new CheckNameAvailabilityRequestBody(json) : null; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/CheckNameAvailabilityResponseBody.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/CheckNameAvailabilityResponseBody.PowerShell.cs similarity index 72% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/CheckNameAvailabilityResponseBody.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/CheckNameAvailabilityResponseBody.PowerShell.cs index 3a9d8eb01f16..d90527e5def5 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/CheckNameAvailabilityResponseBody.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/CheckNameAvailabilityResponseBody.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -57,7 +57,15 @@ public partial class CheckNameAvailabilityResponseBody 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. @@ -72,17 +80,17 @@ internal CheckNameAvailabilityResponseBody(global::System.Collections.IDictionar // actually deserialize if (content.Contains("Valid")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICheckNameAvailabilityResponseBodyInternal)this).Valid = (bool?) content.GetValueForProperty("Valid",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICheckNameAvailabilityResponseBodyInternal)this).Valid, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityResponseBodyInternal)this).Valid = (bool?) content.GetValueForProperty("Valid",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityResponseBodyInternal)this).Valid, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICheckNameAvailabilityResponseBodyInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICheckNameAvailabilityResponseBodyInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityResponseBodyInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityResponseBodyInternal)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. @@ -97,39 +105,37 @@ internal CheckNameAvailabilityResponseBody(global::System.Management.Automation. // actually deserialize if (content.Contains("Valid")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICheckNameAvailabilityResponseBodyInternal)this).Valid = (bool?) content.GetValueForProperty("Valid",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICheckNameAvailabilityResponseBodyInternal)this).Valid, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityResponseBodyInternal)this).Valid = (bool?) content.GetValueForProperty("Valid",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityResponseBodyInternal)this).Valid, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICheckNameAvailabilityResponseBodyInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICheckNameAvailabilityResponseBodyInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityResponseBodyInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityResponseBodyInternal)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.BotService.Models.Api20220615Preview.ICheckNameAvailabilityResponseBody DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityResponseBody DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new CheckNameAvailabilityResponseBody(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.BotService.Models.Api20220615Preview.ICheckNameAvailabilityResponseBody DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityResponseBody DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new CheckNameAvailabilityResponseBody(content); } @@ -141,12 +147,24 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Pr /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICheckNameAvailabilityResponseBody FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityResponseBody FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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 response body returned for a request to Bot Service Management to check availability of a bot name. [System.ComponentModel.TypeConverter(typeof(CheckNameAvailabilityResponseBodyTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/CheckNameAvailabilityResponseBody.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/CheckNameAvailabilityResponseBody.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/CheckNameAvailabilityResponseBody.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/CheckNameAvailabilityResponseBody.TypeConverter.cs index 425f9741a3c3..933ebbc51b17 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/CheckNameAvailabilityResponseBody.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/CheckNameAvailabilityResponseBody.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.ICheckNameAvailabilityResponseBody ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityResponseBody ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICheckNameAvailabilityResponseBody).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityResponseBody).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/CheckNameAvailabilityResponseBody.cs b/generated/BotService/BotService.Autorest/generated/api/Models/CheckNameAvailabilityResponseBody.cs similarity index 89% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/CheckNameAvailabilityResponseBody.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/CheckNameAvailabilityResponseBody.cs index 51f4e8f873b5..1bc8846f4c30 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/CheckNameAvailabilityResponseBody.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/CheckNameAvailabilityResponseBody.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -11,8 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Previe /// The response body returned for a request to Bot Service Management to check availability of a bot name. /// public partial class CheckNameAvailabilityResponseBody : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICheckNameAvailabilityResponseBody, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICheckNameAvailabilityResponseBodyInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityResponseBody, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityResponseBodyInternal { /// Backing field for property. @@ -47,6 +47,9 @@ public partial interface ICheckNameAvailabilityResponseBody : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"additional message from the bot management api showing why a bot name is not available", SerializedName = @"message", PossibleTypes = new [] { typeof(string) })] @@ -55,6 +58,9 @@ public partial interface ICheckNameAvailabilityResponseBody : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"indicates if the bot name is valid.", SerializedName = @"valid", PossibleTypes = new [] { typeof(bool) })] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/CheckNameAvailabilityResponseBody.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/CheckNameAvailabilityResponseBody.json.cs similarity index 93% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/CheckNameAvailabilityResponseBody.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/CheckNameAvailabilityResponseBody.json.cs index c79f3ed76130..d91ee9b3e0fc 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/CheckNameAvailabilityResponseBody.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/CheckNameAvailabilityResponseBody.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -67,19 +67,19 @@ internal CheckNameAvailabilityResponseBody(Microsoft.Azure.PowerShell.Cmdlets.Bo { return; } - {_valid = If( json?.PropertyT("valid"), out var __jsonValid) ? (bool?)__jsonValid : Valid;} - {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message;} + {_valid = If( json?.PropertyT("valid"), out var __jsonValid) ? (bool?)__jsonValid : _valid;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)_message;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICheckNameAvailabilityResponseBody. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityResponseBody. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICheckNameAvailabilityResponseBody. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityResponseBody. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICheckNameAvailabilityResponseBody FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityResponseBody FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new CheckNameAvailabilityResponseBody(json) : null; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ConnectionItemName.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/ConnectionItemName.PowerShell.cs similarity index 77% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ConnectionItemName.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/ConnectionItemName.PowerShell.cs index b4a61751bba4..886a8f05b0b8 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ConnectionItemName.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/ConnectionItemName.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,7 +55,15 @@ public partial class ConnectionItemName 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,13 +78,13 @@ internal ConnectionItemName(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionItemNameInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionItemNameInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionItemNameInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionItemNameInternal)this).Name, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -91,35 +99,33 @@ internal ConnectionItemName(global::System.Management.Automation.PSObject conten // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionItemNameInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionItemNameInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionItemNameInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionItemNameInternal)this).Name, 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.BotService.Models.Api20220615Preview.IConnectionItemName DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionItemName DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ConnectionItemName(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.BotService.Models.Api20220615Preview.IConnectionItemName DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionItemName DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ConnectionItemName(content); } @@ -129,12 +135,24 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Pr /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionItemName FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionItemName FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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 display name of a connection Item Setting registered with the Bot [System.ComponentModel.TypeConverter(typeof(ConnectionItemNameTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ConnectionItemName.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/ConnectionItemName.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ConnectionItemName.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/ConnectionItemName.TypeConverter.cs index 7e755c0f0b7f..99de53f087d6 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ConnectionItemName.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/ConnectionItemName.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IConnectionItemName ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionItemName ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionItemName).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionItemName).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ConnectionItemName.cs b/generated/BotService/BotService.Autorest/generated/api/Models/ConnectionItemName.cs similarity index 84% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ConnectionItemName.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/ConnectionItemName.cs index 0335ce8c540d..9b5e996be775 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ConnectionItemName.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/ConnectionItemName.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// The display name of a connection Item Setting registered with the Bot public partial class ConnectionItemName : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionItemName, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionItemNameInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionItemName, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionItemNameInternal { /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionItemNameInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionItemNameInternal.Name { get => this._name; set { {_name = value;} } } /// Backing field for property. private string _name; @@ -37,6 +37,9 @@ public partial interface IConnectionItemName : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Connection Item name that has been added in the API", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ConnectionItemName.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/ConnectionItemName.json.cs similarity index 93% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ConnectionItemName.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/ConnectionItemName.json.cs index a5f406b268fa..9b22d2626e8a 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ConnectionItemName.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/ConnectionItemName.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -65,18 +65,18 @@ internal ConnectionItemName(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtim { return; } - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionItemName. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionItemName. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionItemName. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionItemName. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionItemName FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionItemName FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new ConnectionItemName(json) : null; } @@ -100,7 +100,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode ToJso { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/ConnectionSetting.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/ConnectionSetting.PowerShell.cs new file mode 100644 index 000000000000..acb5361679a6 --- /dev/null +++ b/generated/BotService/BotService.Autorest/generated/api/Models/ConnectionSetting.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.BotService.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; + + /// Bot channel resource definition + [System.ComponentModel.TypeConverter(typeof(ConnectionSettingTypeConverter))] + public partial class ConnectionSetting + { + + /// + /// 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 ConnectionSetting(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.BotService.Models.IConnectionSettingInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ConnectionSettingPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).SkuName, global::System.Convert.ToString); + } + if (content.Contains("SkuTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).SkuTier = (string) content.GetValueForProperty("SkuTier",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).SkuTier, global::System.Convert.ToString); + } + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.SkuTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Kind = (string) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Kind, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Zone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Zone = (System.Collections.Generic.List) content.GetValueForProperty("Zone",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Zone, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("PropertiesId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingInternal)this).PropertiesId = (string) content.GetValueForProperty("PropertiesId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingInternal)this).PropertiesId, global::System.Convert.ToString); + } + if (content.Contains("PropertiesName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingInternal)this).PropertiesName = (string) content.GetValueForProperty("PropertiesName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingInternal)this).PropertiesName, global::System.Convert.ToString); + } + if (content.Contains("ClientId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingInternal)this).ClientId = (string) content.GetValueForProperty("ClientId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingInternal)this).ClientId, global::System.Convert.ToString); + } + if (content.Contains("SettingId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingInternal)this).SettingId = (string) content.GetValueForProperty("SettingId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingInternal)this).SettingId, global::System.Convert.ToString); + } + if (content.Contains("ClientSecret")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingInternal)this).ClientSecret = (string) content.GetValueForProperty("ClientSecret",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingInternal)this).ClientSecret, global::System.Convert.ToString); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("ServiceProviderId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingInternal)this).ServiceProviderId = (string) content.GetValueForProperty("ServiceProviderId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingInternal)this).ServiceProviderId, global::System.Convert.ToString); + } + if (content.Contains("ServiceProviderDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingInternal)this).ServiceProviderDisplayName = (string) content.GetValueForProperty("ServiceProviderDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingInternal)this).ServiceProviderDisplayName, global::System.Convert.ToString); + } + if (content.Contains("Parameter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingInternal)this).Parameter = (System.Collections.Generic.List) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingInternal)this).Parameter, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ConnectionSettingParameterTypeConverter.ConvertFrom)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingInternal)this).ProvisioningState, 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 ConnectionSetting(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.BotService.Models.IConnectionSettingInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ConnectionSettingPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).SkuName, global::System.Convert.ToString); + } + if (content.Contains("SkuTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).SkuTier = (string) content.GetValueForProperty("SkuTier",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).SkuTier, global::System.Convert.ToString); + } + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.SkuTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Kind = (string) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Kind, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Zone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Zone = (System.Collections.Generic.List) content.GetValueForProperty("Zone",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Zone, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("PropertiesId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingInternal)this).PropertiesId = (string) content.GetValueForProperty("PropertiesId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingInternal)this).PropertiesId, global::System.Convert.ToString); + } + if (content.Contains("PropertiesName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingInternal)this).PropertiesName = (string) content.GetValueForProperty("PropertiesName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingInternal)this).PropertiesName, global::System.Convert.ToString); + } + if (content.Contains("ClientId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingInternal)this).ClientId = (string) content.GetValueForProperty("ClientId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingInternal)this).ClientId, global::System.Convert.ToString); + } + if (content.Contains("SettingId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingInternal)this).SettingId = (string) content.GetValueForProperty("SettingId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingInternal)this).SettingId, global::System.Convert.ToString); + } + if (content.Contains("ClientSecret")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingInternal)this).ClientSecret = (string) content.GetValueForProperty("ClientSecret",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingInternal)this).ClientSecret, global::System.Convert.ToString); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("ServiceProviderId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingInternal)this).ServiceProviderId = (string) content.GetValueForProperty("ServiceProviderId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingInternal)this).ServiceProviderId, global::System.Convert.ToString); + } + if (content.Contains("ServiceProviderDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingInternal)this).ServiceProviderDisplayName = (string) content.GetValueForProperty("ServiceProviderDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingInternal)this).ServiceProviderDisplayName, global::System.Convert.ToString); + } + if (content.Contains("Parameter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingInternal)this).Parameter = (System.Collections.Generic.List) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingInternal)this).Parameter, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ConnectionSettingParameterTypeConverter.ConvertFrom)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingInternal)this).ProvisioningState, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSetting DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ConnectionSetting(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.BotService.Models.IConnectionSetting DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ConnectionSetting(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.BotService.Models.IConnectionSetting FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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(); + } + } + /// Bot channel resource definition + [System.ComponentModel.TypeConverter(typeof(ConnectionSettingTypeConverter))] + public partial interface IConnectionSetting + + { + + } +} \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ConnectionSetting.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/ConnectionSetting.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ConnectionSetting.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/ConnectionSetting.TypeConverter.cs index 214704f4ae25..a3ccd21b4b9c 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ConnectionSetting.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/ConnectionSetting.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IConnectionSetting ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSetting ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSetting).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSetting).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ConnectionSetting.cs b/generated/BotService/BotService.Autorest/generated/api/Models/ConnectionSetting.cs similarity index 59% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ConnectionSetting.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/ConnectionSetting.cs index f3d96a70289f..1663871e0b54 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ConnectionSetting.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/ConnectionSetting.cs @@ -3,133 +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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// Bot channel resource definition public partial class ConnectionSetting : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSetting, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingInternal, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSetting, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingInternal, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Resource(); + private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Resource(); /// Client Id associated with the Connection Setting. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string ClientId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingPropertiesInternal)Property).ClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingPropertiesInternal)Property).ClientId = value ?? null; } + public string ClientId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingPropertiesInternal)Property).ClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingPropertiesInternal)Property).ClientId = value ?? null; } /// Client Secret associated with the Connection Setting [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string ClientSecret { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingPropertiesInternal)Property).ClientSecret; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingPropertiesInternal)Property).ClientSecret = value ?? null; } + public string ClientSecret { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingPropertiesInternal)Property).ClientSecret; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingPropertiesInternal)Property).ClientSecret = value ?? null; } /// Entity Tag [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Etag = value ?? null; } + public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Etag = value ?? null; } /// Specifies the resource ID. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Id; } /// Required. Gets or sets the Kind of the resource. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Kind? Kind { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Kind; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Kind = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Kind)""); } + public string Kind { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Kind; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Kind = value ?? null; } /// Specifies the location of the resource. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Location = value ?? null; } + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Location = value ?? null; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingProperties Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ConnectionSettingProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingProperties Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ConnectionSettingProperties()); set { {_property = value;} } } /// Internal Acessors for SettingId - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingInternal.SettingId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingPropertiesInternal)Property).SettingId; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingPropertiesInternal)Property).SettingId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingInternal.SettingId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingPropertiesInternal)Property).SettingId; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingPropertiesInternal)Property).SettingId = value; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Id = value; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Sku + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISku Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal.Sku { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Sku; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Sku = value; } /// Internal Acessors for SkuTier - Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuTier? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal.SkuTier { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).SkuTier; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).SkuTier = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal.SkuTier { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).SkuTier; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).SkuTier = value; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Type = value; } /// Internal Acessors for Zone - string[] Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal.Zone { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Zone; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Zone = value; } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal.Zone { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Zone; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Zone = value; } /// Specifies the name of the resource. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Name; } /// Service Provider Parameters associated with the Connection Setting [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingParameter[] Parameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingPropertiesInternal)Property).Parameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingPropertiesInternal)Property).Parameter = value ?? null /* arrayOf */; } + public System.Collections.Generic.List Parameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingPropertiesInternal)Property).Parameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingPropertiesInternal)Property).Parameter = value ?? null /* arrayOf */; } /// Id associated with the Connection Setting. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string PropertiesId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingPropertiesInternal)Property).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingPropertiesInternal)Property).Id = value ?? null; } + public string PropertiesId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingPropertiesInternal)Property).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingPropertiesInternal)Property).Id = value ?? null; } /// Name associated with the Connection Setting. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string PropertiesName { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingPropertiesInternal)Property).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingPropertiesInternal)Property).Name = value ?? null; } + public string PropertiesName { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingPropertiesInternal)Property).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingPropertiesInternal)Property).Name = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingProperties _property; /// The set of properties specific to bot channel resource [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ConnectionSettingProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ConnectionSettingProperties()); set => this._property = value; } /// Provisioning state of the resource [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingPropertiesInternal)Property).ProvisioningState = value ?? null; } + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingPropertiesInternal)Property).ProvisioningState = value ?? null; } + + /// Gets the resource group name + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.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); } /// Scopes associated with the Connection Setting [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingPropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingPropertiesInternal)Property).Scope = value ?? null; } + public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingPropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingPropertiesInternal)Property).Scope = value ?? null; } /// Service Provider Display Name associated with the Connection Setting [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string ServiceProviderDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingPropertiesInternal)Property).ServiceProviderDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingPropertiesInternal)Property).ServiceProviderDisplayName = value ?? null; } + public string ServiceProviderDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingPropertiesInternal)Property).ServiceProviderDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingPropertiesInternal)Property).ServiceProviderDisplayName = value ?? null; } /// Service Provider Id associated with the Connection Setting [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string ServiceProviderId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingPropertiesInternal)Property).ServiceProviderId; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingPropertiesInternal)Property).ServiceProviderId = value ?? null; } + public string ServiceProviderId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingPropertiesInternal)Property).ServiceProviderId; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingPropertiesInternal)Property).ServiceProviderId = value ?? null; } /// Setting Id set by the service for the Connection Setting. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string SettingId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingPropertiesInternal)Property).SettingId; } + public string SettingId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingPropertiesInternal)Property).SettingId; } /// Gets or sets the SKU of the resource. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISku Sku { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Sku; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Sku = value ?? null /* model class */; } + internal Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISku Sku { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Sku; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Sku = value ?? null /* model class */; } /// The sku name [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName? SkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).SkuName; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).SkuName = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName)""); } + public string SkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).SkuName; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).SkuName = value ?? null; } /// Gets the sku tier. This is based on the SKU name. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuTier? SkuTier { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).SkuTier; } + public string SkuTier { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).SkuTier; } /// Contains resource tags defined as key/value pairs. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Tag = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Tag = value ?? null /* model class */; } /// Specifies the type of the resource. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Type; } /// Entity zones [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string[] Zone { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__resource).Zone; } + public System.Collections.Generic.List Zone { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__resource).Zone; } /// Creates an new instance. public ConnectionSetting() @@ -152,12 +158,15 @@ public ConnectionSetting() /// Bot channel resource definition public partial interface IConnectionSetting : Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResource + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResource { /// Client Id associated with the Connection Setting. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Client Id associated with the Connection Setting.", SerializedName = @"clientId", PossibleTypes = new [] { typeof(string) })] @@ -166,6 +175,9 @@ public partial interface IConnectionSetting : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Client Secret associated with the Connection Setting", SerializedName = @"clientSecret", PossibleTypes = new [] { typeof(string) })] @@ -174,14 +186,20 @@ public partial interface IConnectionSetting : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Service Provider Parameters associated with the Connection Setting", SerializedName = @"parameters", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingParameter) })] - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingParameter[] Parameter { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingParameter) })] + System.Collections.Generic.List Parameter { get; set; } /// Id associated with the Connection Setting. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Id associated with the Connection Setting.", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -190,6 +208,9 @@ public partial interface IConnectionSetting : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Name associated with the Connection Setting.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -198,6 +219,9 @@ public partial interface IConnectionSetting : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Provisioning state of the resource", SerializedName = @"provisioningState", PossibleTypes = new [] { typeof(string) })] @@ -206,6 +230,9 @@ public partial interface IConnectionSetting : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Scopes associated with the Connection Setting", SerializedName = @"scopes", PossibleTypes = new [] { typeof(string) })] @@ -214,6 +241,9 @@ public partial interface IConnectionSetting : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Service Provider Display Name associated with the Connection Setting", SerializedName = @"serviceProviderDisplayName", PossibleTypes = new [] { typeof(string) })] @@ -222,6 +252,9 @@ public partial interface IConnectionSetting : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Service Provider Id associated with the Connection Setting", SerializedName = @"serviceProviderId", PossibleTypes = new [] { typeof(string) })] @@ -230,6 +263,9 @@ public partial interface IConnectionSetting : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Setting Id set by the service for the Connection Setting.", SerializedName = @"settingId", PossibleTypes = new [] { typeof(string) })] @@ -238,20 +274,20 @@ public partial interface IConnectionSetting : } /// Bot channel resource definition internal partial interface IConnectionSettingInternal : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal { /// Client Id associated with the Connection Setting. string ClientId { get; set; } /// Client Secret associated with the Connection Setting string ClientSecret { get; set; } /// Service Provider Parameters associated with the Connection Setting - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingParameter[] Parameter { get; set; } + System.Collections.Generic.List Parameter { get; set; } /// Id associated with the Connection Setting. string PropertiesId { get; set; } /// Name associated with the Connection Setting. string PropertiesName { get; set; } /// The set of properties specific to bot channel resource - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingProperties Property { get; set; } /// Provisioning state of the resource string ProvisioningState { get; set; } /// Scopes associated with the Connection Setting diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ConnectionSetting.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/ConnectionSetting.json.cs similarity index 92% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ConnectionSetting.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/ConnectionSetting.json.cs index d6a34512dc57..0d8ff136562c 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ConnectionSetting.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/ConnectionSetting.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -65,19 +65,19 @@ internal ConnectionSetting(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime { return; } - __resource = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Resource(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ConnectionSettingProperties.FromJson(__jsonProperties) : Property;} + __resource = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ConnectionSettingProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSetting. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSetting. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSetting. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSetting. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSetting FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSetting FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new ConnectionSetting(json) : null; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ConnectionSettingParameter.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/ConnectionSettingParameter.PowerShell.cs similarity index 74% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ConnectionSettingParameter.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/ConnectionSettingParameter.PowerShell.cs index ac7a3c2bfc4a..63ff64d1da67 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ConnectionSettingParameter.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/ConnectionSettingParameter.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -57,7 +57,15 @@ public partial class ConnectionSettingParameter 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. @@ -72,17 +80,17 @@ internal ConnectionSettingParameter(global::System.Collections.IDictionary conte // actually deserialize if (content.Contains("Key")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingParameterInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingParameterInternal)this).Key, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingParameterInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingParameterInternal)this).Key, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingParameterInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingParameterInternal)this).Value, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingParameterInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingParameterInternal)this).Value, 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. @@ -97,39 +105,37 @@ internal ConnectionSettingParameter(global::System.Management.Automation.PSObjec // actually deserialize if (content.Contains("Key")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingParameterInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingParameterInternal)this).Key, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingParameterInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingParameterInternal)this).Key, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingParameterInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingParameterInternal)this).Value, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingParameterInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingParameterInternal)this).Value, 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.BotService.Models.Api20220615Preview.IConnectionSettingParameter DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingParameter DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ConnectionSettingParameter(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.BotService.Models.Api20220615Preview.IConnectionSettingParameter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingParameter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ConnectionSettingParameter(content); } @@ -139,12 +145,24 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Pr /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingParameter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingParameter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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(); + } } /// Extra Parameter in a Connection Setting Properties to indicate service provider specific properties [System.ComponentModel.TypeConverter(typeof(ConnectionSettingParameterTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ConnectionSettingParameter.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/ConnectionSettingParameter.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ConnectionSettingParameter.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/ConnectionSettingParameter.TypeConverter.cs index ec4e0530016d..835b15e64dcd 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ConnectionSettingParameter.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/ConnectionSettingParameter.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IConnectionSettingParameter ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingParameter ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingParameter).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingParameter).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ConnectionSettingParameter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/ConnectionSettingParameter.cs similarity index 88% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ConnectionSettingParameter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/ConnectionSettingParameter.cs index ab0388db6d10..8cd9037704d2 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ConnectionSettingParameter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/ConnectionSettingParameter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -11,8 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Previe /// Extra Parameter in a Connection Setting Properties to indicate service provider specific properties /// public partial class ConnectionSettingParameter : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingParameter, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingParameterInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingParameter, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingParameterInternal { /// Backing field for property. @@ -43,6 +43,9 @@ public partial interface IConnectionSettingParameter : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Key for the Connection Setting Parameter.", SerializedName = @"key", PossibleTypes = new [] { typeof(string) })] @@ -51,6 +54,9 @@ public partial interface IConnectionSettingParameter : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Value associated with the Connection Setting Parameter.", SerializedName = @"value", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ConnectionSettingParameter.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/ConnectionSettingParameter.json.cs similarity index 93% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ConnectionSettingParameter.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/ConnectionSettingParameter.json.cs index 61f3dfb34978..d3751c0b95a1 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ConnectionSettingParameter.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/ConnectionSettingParameter.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -67,19 +67,19 @@ internal ConnectionSettingParameter(Microsoft.Azure.PowerShell.Cmdlets.BotServic { return; } - {_key = If( json?.PropertyT("key"), out var __jsonKey) ? (string)__jsonKey : (string)Key;} - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)Value;} + {_key = If( json?.PropertyT("key"), out var __jsonKey) ? (string)__jsonKey : (string)_key;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)_value;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingParameter. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingParameter. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingParameter. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingParameter. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingParameter FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingParameter FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new ConnectionSettingParameter(json) : null; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ConnectionSettingProperties.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/ConnectionSettingProperties.PowerShell.cs similarity index 55% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ConnectionSettingProperties.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/ConnectionSettingProperties.PowerShell.cs index 345275c2e7ea..7018cc5cf955 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ConnectionSettingProperties.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/ConnectionSettingProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,7 +55,15 @@ public partial class ConnectionSettingProperties 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,49 +78,49 @@ internal ConnectionSettingProperties(global::System.Collections.IDictionary cont // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingPropertiesInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingPropertiesInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingPropertiesInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingPropertiesInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingPropertiesInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingPropertiesInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingPropertiesInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingPropertiesInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("ClientId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingPropertiesInternal)this).ClientId = (string) content.GetValueForProperty("ClientId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingPropertiesInternal)this).ClientId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingPropertiesInternal)this).ClientId = (string) content.GetValueForProperty("ClientId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingPropertiesInternal)this).ClientId, global::System.Convert.ToString); } if (content.Contains("SettingId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingPropertiesInternal)this).SettingId = (string) content.GetValueForProperty("SettingId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingPropertiesInternal)this).SettingId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingPropertiesInternal)this).SettingId = (string) content.GetValueForProperty("SettingId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingPropertiesInternal)this).SettingId, global::System.Convert.ToString); } if (content.Contains("ClientSecret")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingPropertiesInternal)this).ClientSecret = (string) content.GetValueForProperty("ClientSecret",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingPropertiesInternal)this).ClientSecret, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingPropertiesInternal)this).ClientSecret = (string) content.GetValueForProperty("ClientSecret",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingPropertiesInternal)this).ClientSecret, global::System.Convert.ToString); } if (content.Contains("Scope")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingPropertiesInternal)this).Scope, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingPropertiesInternal)this).Scope, global::System.Convert.ToString); } if (content.Contains("ServiceProviderId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingPropertiesInternal)this).ServiceProviderId = (string) content.GetValueForProperty("ServiceProviderId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingPropertiesInternal)this).ServiceProviderId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingPropertiesInternal)this).ServiceProviderId = (string) content.GetValueForProperty("ServiceProviderId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingPropertiesInternal)this).ServiceProviderId, global::System.Convert.ToString); } if (content.Contains("ServiceProviderDisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingPropertiesInternal)this).ServiceProviderDisplayName = (string) content.GetValueForProperty("ServiceProviderDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingPropertiesInternal)this).ServiceProviderDisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingPropertiesInternal)this).ServiceProviderDisplayName = (string) content.GetValueForProperty("ServiceProviderDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingPropertiesInternal)this).ServiceProviderDisplayName, global::System.Convert.ToString); } if (content.Contains("Parameter")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingPropertiesInternal)this).Parameter = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingParameter[]) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingPropertiesInternal)this).Parameter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ConnectionSettingParameterTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingPropertiesInternal)this).Parameter = (System.Collections.Generic.List) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingPropertiesInternal)this).Parameter, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ConnectionSettingParameterTypeConverter.ConvertFrom)); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingPropertiesInternal)this).ProvisioningState, 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,71 +135,69 @@ internal ConnectionSettingProperties(global::System.Management.Automation.PSObje // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingPropertiesInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingPropertiesInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingPropertiesInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingPropertiesInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingPropertiesInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingPropertiesInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingPropertiesInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingPropertiesInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("ClientId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingPropertiesInternal)this).ClientId = (string) content.GetValueForProperty("ClientId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingPropertiesInternal)this).ClientId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingPropertiesInternal)this).ClientId = (string) content.GetValueForProperty("ClientId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingPropertiesInternal)this).ClientId, global::System.Convert.ToString); } if (content.Contains("SettingId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingPropertiesInternal)this).SettingId = (string) content.GetValueForProperty("SettingId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingPropertiesInternal)this).SettingId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingPropertiesInternal)this).SettingId = (string) content.GetValueForProperty("SettingId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingPropertiesInternal)this).SettingId, global::System.Convert.ToString); } if (content.Contains("ClientSecret")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingPropertiesInternal)this).ClientSecret = (string) content.GetValueForProperty("ClientSecret",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingPropertiesInternal)this).ClientSecret, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingPropertiesInternal)this).ClientSecret = (string) content.GetValueForProperty("ClientSecret",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingPropertiesInternal)this).ClientSecret, global::System.Convert.ToString); } if (content.Contains("Scope")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingPropertiesInternal)this).Scope, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingPropertiesInternal)this).Scope, global::System.Convert.ToString); } if (content.Contains("ServiceProviderId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingPropertiesInternal)this).ServiceProviderId = (string) content.GetValueForProperty("ServiceProviderId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingPropertiesInternal)this).ServiceProviderId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingPropertiesInternal)this).ServiceProviderId = (string) content.GetValueForProperty("ServiceProviderId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingPropertiesInternal)this).ServiceProviderId, global::System.Convert.ToString); } if (content.Contains("ServiceProviderDisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingPropertiesInternal)this).ServiceProviderDisplayName = (string) content.GetValueForProperty("ServiceProviderDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingPropertiesInternal)this).ServiceProviderDisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingPropertiesInternal)this).ServiceProviderDisplayName = (string) content.GetValueForProperty("ServiceProviderDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingPropertiesInternal)this).ServiceProviderDisplayName, global::System.Convert.ToString); } if (content.Contains("Parameter")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingPropertiesInternal)this).Parameter = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingParameter[]) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingPropertiesInternal)this).Parameter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ConnectionSettingParameterTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingPropertiesInternal)this).Parameter = (System.Collections.Generic.List) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingPropertiesInternal)this).Parameter, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ConnectionSettingParameterTypeConverter.ConvertFrom)); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingPropertiesInternal)this).ProvisioningState, 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.BotService.Models.Api20220615Preview.IConnectionSettingProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ConnectionSettingProperties(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.BotService.Models.Api20220615Preview.IConnectionSettingProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ConnectionSettingProperties(content); } @@ -201,12 +207,24 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Pr /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Properties for a Connection Setting Item [System.ComponentModel.TypeConverter(typeof(ConnectionSettingPropertiesTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ConnectionSettingProperties.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/ConnectionSettingProperties.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ConnectionSettingProperties.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/ConnectionSettingProperties.TypeConverter.cs index df1993919b0f..c02f978811e6 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ConnectionSettingProperties.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/ConnectionSettingProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IConnectionSettingProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ConnectionSettingProperties.cs b/generated/BotService/BotService.Autorest/generated/api/Models/ConnectionSettingProperties.cs similarity index 86% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ConnectionSettingProperties.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/ConnectionSettingProperties.cs index c38c9af3f740..20666de01a16 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ConnectionSettingProperties.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/ConnectionSettingProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// Properties for a Connection Setting Item public partial class ConnectionSettingProperties : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingProperties, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingProperties, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingPropertiesInternal { /// Backing field for property. @@ -35,7 +35,7 @@ public partial class ConnectionSettingProperties : public string Id { get => this._id; set => this._id = value; } /// Internal Acessors for SettingId - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingPropertiesInternal.SettingId { get => this._settingId; set { {_settingId = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingPropertiesInternal.SettingId { get => this._settingId; set { {_settingId = value;} } } /// Backing field for property. private string _name; @@ -45,11 +45,11 @@ public partial class ConnectionSettingProperties : public string Name { get => this._name; set => this._name = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingParameter[] _parameter; + private System.Collections.Generic.List _parameter; /// Service Provider Parameters associated with the Connection Setting [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingParameter[] Parameter { get => this._parameter; set => this._parameter = value; } + public System.Collections.Generic.List Parameter { get => this._parameter; set => this._parameter = value; } /// Backing field for property. private string _provisioningState; @@ -100,6 +100,9 @@ public partial interface IConnectionSettingProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Client Id associated with the Connection Setting.", SerializedName = @"clientId", PossibleTypes = new [] { typeof(string) })] @@ -108,6 +111,9 @@ public partial interface IConnectionSettingProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Client Secret associated with the Connection Setting", SerializedName = @"clientSecret", PossibleTypes = new [] { typeof(string) })] @@ -116,6 +122,9 @@ public partial interface IConnectionSettingProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Id associated with the Connection Setting.", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -124,6 +133,9 @@ public partial interface IConnectionSettingProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Name associated with the Connection Setting.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -132,14 +144,20 @@ public partial interface IConnectionSettingProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Service Provider Parameters associated with the Connection Setting", SerializedName = @"parameters", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingParameter) })] - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingParameter[] Parameter { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingParameter) })] + System.Collections.Generic.List Parameter { get; set; } /// Provisioning state of the resource [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Provisioning state of the resource", SerializedName = @"provisioningState", PossibleTypes = new [] { typeof(string) })] @@ -148,6 +166,9 @@ public partial interface IConnectionSettingProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Scopes associated with the Connection Setting", SerializedName = @"scopes", PossibleTypes = new [] { typeof(string) })] @@ -156,6 +177,9 @@ public partial interface IConnectionSettingProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Service Provider Display Name associated with the Connection Setting", SerializedName = @"serviceProviderDisplayName", PossibleTypes = new [] { typeof(string) })] @@ -164,6 +188,9 @@ public partial interface IConnectionSettingProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Service Provider Id associated with the Connection Setting", SerializedName = @"serviceProviderId", PossibleTypes = new [] { typeof(string) })] @@ -172,6 +199,9 @@ public partial interface IConnectionSettingProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Setting Id set by the service for the Connection Setting.", SerializedName = @"settingId", PossibleTypes = new [] { typeof(string) })] @@ -191,7 +221,7 @@ internal partial interface IConnectionSettingPropertiesInternal /// Name associated with the Connection Setting. string Name { get; set; } /// Service Provider Parameters associated with the Connection Setting - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingParameter[] Parameter { get; set; } + System.Collections.Generic.List Parameter { get; set; } /// Provisioning state of the resource string ProvisioningState { get; set; } /// Scopes associated with the Connection Setting diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ConnectionSettingProperties.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/ConnectionSettingProperties.json.cs similarity index 89% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ConnectionSettingProperties.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/ConnectionSettingProperties.json.cs index 9872732b128e..5bf184ff3733 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ConnectionSettingProperties.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/ConnectionSettingProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -65,27 +65,27 @@ internal ConnectionSettingProperties(Microsoft.Azure.PowerShell.Cmdlets.BotServi { 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;} - {_clientId = If( json?.PropertyT("clientId"), out var __jsonClientId) ? (string)__jsonClientId : (string)ClientId;} - {_settingId = If( json?.PropertyT("settingId"), out var __jsonSettingId) ? (string)__jsonSettingId : (string)SettingId;} - {_clientSecret = If( json?.PropertyT("clientSecret"), out var __jsonClientSecret) ? (string)__jsonClientSecret : (string)ClientSecret;} - {_scope = If( json?.PropertyT("scopes"), out var __jsonScopes) ? (string)__jsonScopes : (string)Scope;} - {_serviceProviderId = If( json?.PropertyT("serviceProviderId"), out var __jsonServiceProviderId) ? (string)__jsonServiceProviderId : (string)ServiceProviderId;} - {_serviceProviderDisplayName = If( json?.PropertyT("serviceProviderDisplayName"), out var __jsonServiceProviderDisplayName) ? (string)__jsonServiceProviderDisplayName : (string)ServiceProviderDisplayName;} - {_parameter = If( json?.PropertyT("parameters"), out var __jsonParameters) ? If( __jsonParameters as Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IConnectionSettingParameter) (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ConnectionSettingParameter.FromJson(__u) )) ))() : null : Parameter;} - {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_clientId = If( json?.PropertyT("clientId"), out var __jsonClientId) ? (string)__jsonClientId : (string)_clientId;} + {_settingId = If( json?.PropertyT("settingId"), out var __jsonSettingId) ? (string)__jsonSettingId : (string)_settingId;} + {_clientSecret = If( json?.PropertyT("clientSecret"), out var __jsonClientSecret) ? (string)__jsonClientSecret : (string)_clientSecret;} + {_scope = If( json?.PropertyT("scopes"), out var __jsonScopes) ? (string)__jsonScopes : (string)_scope;} + {_serviceProviderId = If( json?.PropertyT("serviceProviderId"), out var __jsonServiceProviderId) ? (string)__jsonServiceProviderId : (string)_serviceProviderId;} + {_serviceProviderDisplayName = If( json?.PropertyT("serviceProviderDisplayName"), out var __jsonServiceProviderDisplayName) ? (string)__jsonServiceProviderDisplayName : (string)_serviceProviderDisplayName;} + {_parameter = If( json?.PropertyT("parameters"), out var __jsonParameters) ? If( __jsonParameters as Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.IConnectionSettingParameter) (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ConnectionSettingParameter.FromJson(__u) )) ))() : null : _parameter;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new ConnectionSettingProperties(json) : null; } @@ -112,7 +112,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode ToJso AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); AddIf( null != (((object)this._clientId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._clientId.ToString()) : null, "clientId" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._settingId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._settingId.ToString()) : null, "settingId" ,container.Add ); } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ConnectionSettingResponseList.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/ConnectionSettingResponseList.PowerShell.cs similarity index 69% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ConnectionSettingResponseList.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/ConnectionSettingResponseList.PowerShell.cs index 2da768a57dbd..b4b2789e041c 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ConnectionSettingResponseList.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/ConnectionSettingResponseList.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,7 +55,15 @@ public partial class ConnectionSettingResponseList 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 ConnectionSettingResponseList(global::System.Collections.IDictionary co // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingResponseListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingResponseListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingResponseListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingResponseListInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingResponseListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSetting[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingResponseListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ConnectionSettingTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingResponseListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingResponseListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ConnectionSettingTypeConverter.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. @@ -95,39 +103,37 @@ internal ConnectionSettingResponseList(global::System.Management.Automation.PSOb // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingResponseListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingResponseListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingResponseListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingResponseListInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingResponseListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSetting[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingResponseListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ConnectionSettingTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingResponseListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingResponseListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ConnectionSettingTypeConverter.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.BotService.Models.Api20220615Preview.IConnectionSettingResponseList DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingResponseList DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ConnectionSettingResponseList(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.BotService.Models.Api20220615Preview.IConnectionSettingResponseList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingResponseList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ConnectionSettingResponseList(content); } @@ -137,12 +143,24 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Pr /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingResponseList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingResponseList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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 list of bot service connection settings response. [System.ComponentModel.TypeConverter(typeof(ConnectionSettingResponseListTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ConnectionSettingResponseList.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/ConnectionSettingResponseList.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ConnectionSettingResponseList.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/ConnectionSettingResponseList.TypeConverter.cs index 312c5b683325..ab00d77a09da 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ConnectionSettingResponseList.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/ConnectionSettingResponseList.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IConnectionSettingResponseList ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingResponseList ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingResponseList).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingResponseList).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ConnectionSettingResponseList.cs b/generated/BotService/BotService.Autorest/generated/api/Models/ConnectionSettingResponseList.cs similarity index 70% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ConnectionSettingResponseList.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/ConnectionSettingResponseList.cs index b7bdcc12f644..e3c10512ea32 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ConnectionSettingResponseList.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/ConnectionSettingResponseList.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// The list of bot service connection settings response. public partial class ConnectionSettingResponseList : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingResponseList, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingResponseListInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingResponseList, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingResponseListInternal { /// Internal Acessors for Value - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSetting[] Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingResponseListInternal.Value { get => this._value; set { {_value = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingResponseListInternal.Value { get => this._value; set { {_value = value;} } } /// Backing field for property. private string _nextLink; @@ -24,11 +24,11 @@ public partial class ConnectionSettingResponseList : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSetting[] _value; + private System.Collections.Generic.List _value; /// Gets the list of bot service connection settings and their properties. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSetting[] Value { get => this._value; } + public System.Collections.Generic.List Value { get => this._value; } /// Creates an new instance. public ConnectionSettingResponseList() @@ -44,6 +44,9 @@ public partial interface IConnectionSettingResponseList : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The link used to get the next page of bot service connection setting resources.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -52,10 +55,13 @@ public partial interface IConnectionSettingResponseList : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Gets the list of bot service connection settings and their properties.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSetting) })] - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSetting[] Value { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSetting) })] + System.Collections.Generic.List Value { get; } } /// The list of bot service connection settings response. @@ -65,7 +71,7 @@ internal partial interface IConnectionSettingResponseListInternal /// The link used to get the next page of bot service connection setting resources. string NextLink { get; set; } /// Gets the list of bot service connection settings and their properties. - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSetting[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ConnectionSettingResponseList.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/ConnectionSettingResponseList.json.cs similarity index 88% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ConnectionSettingResponseList.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/ConnectionSettingResponseList.json.cs index 05455e2b989b..5dc635cca2ad 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ConnectionSettingResponseList.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/ConnectionSettingResponseList.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -65,19 +65,19 @@ internal ConnectionSettingResponseList(Microsoft.Azure.PowerShell.Cmdlets.BotSer { return; } - {_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.BotService.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.BotService.Models.Api20220615Preview.IConnectionSetting) (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ConnectionSetting.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.BotService.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.BotService.Models.IConnectionSetting) (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ConnectionSetting.FromJson(__u) )) ))() : null : _value;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingResponseList. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingResponseList. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingResponseList. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingResponseList. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSettingResponseList FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IConnectionSettingResponseList FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new ConnectionSettingResponseList(json) : null; } @@ -102,7 +102,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode ToJso return container; } AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)) { if (null != this._value) { diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/CreateEmailSignInUrlResponse.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/CreateEmailSignInUrlResponse.PowerShell.cs similarity index 66% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/CreateEmailSignInUrlResponse.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/CreateEmailSignInUrlResponse.PowerShell.cs index 51b9c61e3e37..59813c9589f2 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/CreateEmailSignInUrlResponse.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/CreateEmailSignInUrlResponse.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,7 +55,15 @@ public partial class CreateEmailSignInUrlResponse 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,25 +78,25 @@ internal CreateEmailSignInUrlResponse(global::System.Collections.IDictionary con // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICreateEmailSignInUrlResponseInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICreateEmailSignInUrlResponseProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICreateEmailSignInUrlResponseInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.CreateEmailSignInUrlResponsePropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICreateEmailSignInUrlResponseInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICreateEmailSignInUrlResponseProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICreateEmailSignInUrlResponseInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.CreateEmailSignInUrlResponsePropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICreateEmailSignInUrlResponseInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICreateEmailSignInUrlResponseInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICreateEmailSignInUrlResponseInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICreateEmailSignInUrlResponseInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICreateEmailSignInUrlResponseInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICreateEmailSignInUrlResponseInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICreateEmailSignInUrlResponseInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICreateEmailSignInUrlResponseInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("Url")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICreateEmailSignInUrlResponseInternal)this).Url = (string) content.GetValueForProperty("Url",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICreateEmailSignInUrlResponseInternal)this).Url, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICreateEmailSignInUrlResponseInternal)this).Url = (string) content.GetValueForProperty("Url",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICreateEmailSignInUrlResponseInternal)this).Url, 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,47 +111,45 @@ internal CreateEmailSignInUrlResponse(global::System.Management.Automation.PSObj // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICreateEmailSignInUrlResponseInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICreateEmailSignInUrlResponseProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICreateEmailSignInUrlResponseInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.CreateEmailSignInUrlResponsePropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICreateEmailSignInUrlResponseInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICreateEmailSignInUrlResponseProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICreateEmailSignInUrlResponseInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.CreateEmailSignInUrlResponsePropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICreateEmailSignInUrlResponseInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICreateEmailSignInUrlResponseInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICreateEmailSignInUrlResponseInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICreateEmailSignInUrlResponseInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICreateEmailSignInUrlResponseInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICreateEmailSignInUrlResponseInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICreateEmailSignInUrlResponseInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICreateEmailSignInUrlResponseInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("Url")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICreateEmailSignInUrlResponseInternal)this).Url = (string) content.GetValueForProperty("Url",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICreateEmailSignInUrlResponseInternal)this).Url, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICreateEmailSignInUrlResponseInternal)this).Url = (string) content.GetValueForProperty("Url",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICreateEmailSignInUrlResponseInternal)this).Url, 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.BotService.Models.Api20220615Preview.ICreateEmailSignInUrlResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICreateEmailSignInUrlResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new CreateEmailSignInUrlResponse(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.BotService.Models.Api20220615Preview.ICreateEmailSignInUrlResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICreateEmailSignInUrlResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new CreateEmailSignInUrlResponse(content); } @@ -153,12 +159,24 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Pr /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICreateEmailSignInUrlResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICreateEmailSignInUrlResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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 ARM create email sign in url operation response. [System.ComponentModel.TypeConverter(typeof(CreateEmailSignInUrlResponseTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/CreateEmailSignInUrlResponse.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/CreateEmailSignInUrlResponse.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/CreateEmailSignInUrlResponse.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/CreateEmailSignInUrlResponse.TypeConverter.cs index b88e631c57e2..cbce70dca423 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/CreateEmailSignInUrlResponse.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/CreateEmailSignInUrlResponse.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.ICreateEmailSignInUrlResponse ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICreateEmailSignInUrlResponse ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICreateEmailSignInUrlResponse).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICreateEmailSignInUrlResponse).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/CreateEmailSignInUrlResponse.cs b/generated/BotService/BotService.Autorest/generated/api/Models/CreateEmailSignInUrlResponse.cs similarity index 63% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/CreateEmailSignInUrlResponse.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/CreateEmailSignInUrlResponse.cs index dfc2c142a60e..3440b45dde36 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/CreateEmailSignInUrlResponse.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/CreateEmailSignInUrlResponse.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// The ARM create email sign in url operation response. public partial class CreateEmailSignInUrlResponse : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICreateEmailSignInUrlResponse, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICreateEmailSignInUrlResponseInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICreateEmailSignInUrlResponse, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICreateEmailSignInUrlResponseInternal { /// Backing field for property. @@ -28,21 +28,25 @@ public partial class CreateEmailSignInUrlResponse : public string Location { get => this._location; set => this._location = value; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICreateEmailSignInUrlResponseInternal.Id { get => this._id; set { {_id = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICreateEmailSignInUrlResponseInternal.Id { get => this._id; set { {_id = value;} } } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICreateEmailSignInUrlResponseProperties Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICreateEmailSignInUrlResponseInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.CreateEmailSignInUrlResponseProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICreateEmailSignInUrlResponseProperties Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICreateEmailSignInUrlResponseInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.CreateEmailSignInUrlResponseProperties()); set { {_property = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICreateEmailSignInUrlResponseProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICreateEmailSignInUrlResponseProperties _property; /// The set of properties specific to sign in url [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICreateEmailSignInUrlResponseProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.CreateEmailSignInUrlResponseProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICreateEmailSignInUrlResponseProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.CreateEmailSignInUrlResponseProperties()); set => this._property = value; } + + /// Gets the resource group name + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.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); } /// Sign in url. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string Url { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICreateEmailSignInUrlResponsePropertiesInternal)Property).Url; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICreateEmailSignInUrlResponsePropertiesInternal)Property).Url = value ?? null; } + public string Url { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICreateEmailSignInUrlResponsePropertiesInternal)Property).Url; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICreateEmailSignInUrlResponsePropertiesInternal)Property).Url = value ?? null; } /// Creates an new instance. public CreateEmailSignInUrlResponse() @@ -58,6 +62,9 @@ public partial interface ICreateEmailSignInUrlResponse : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Specifies the resource ID.", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -66,6 +73,9 @@ public partial interface ICreateEmailSignInUrlResponse : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Specifies the location of the resource.", SerializedName = @"location", PossibleTypes = new [] { typeof(string) })] @@ -74,6 +84,9 @@ public partial interface ICreateEmailSignInUrlResponse : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Sign in url.", SerializedName = @"url", PossibleTypes = new [] { typeof(string) })] @@ -89,7 +102,7 @@ internal partial interface ICreateEmailSignInUrlResponseInternal /// Specifies the location of the resource. string Location { get; set; } /// The set of properties specific to sign in url - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICreateEmailSignInUrlResponseProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICreateEmailSignInUrlResponseProperties Property { get; set; } /// Sign in url. string Url { get; set; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/CreateEmailSignInUrlResponse.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/CreateEmailSignInUrlResponse.json.cs similarity index 91% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/CreateEmailSignInUrlResponse.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/CreateEmailSignInUrlResponse.json.cs index 46b41e154322..83cd76175dac 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/CreateEmailSignInUrlResponse.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/CreateEmailSignInUrlResponse.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -65,20 +65,20 @@ internal CreateEmailSignInUrlResponse(Microsoft.Azure.PowerShell.Cmdlets.BotServ { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.CreateEmailSignInUrlResponseProperties.FromJson(__jsonProperties) : Property;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)Location;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.CreateEmailSignInUrlResponseProperties.FromJson(__jsonProperties) : _property;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)_location;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICreateEmailSignInUrlResponse. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICreateEmailSignInUrlResponse. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICreateEmailSignInUrlResponse. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICreateEmailSignInUrlResponse. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICreateEmailSignInUrlResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICreateEmailSignInUrlResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new CreateEmailSignInUrlResponse(json) : null; } @@ -103,7 +103,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode ToJso return container; } AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/CreateEmailSignInUrlResponseProperties.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/CreateEmailSignInUrlResponseProperties.PowerShell.cs similarity index 76% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/CreateEmailSignInUrlResponseProperties.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/CreateEmailSignInUrlResponseProperties.PowerShell.cs index ccfe93b69098..3eb6dbf33e20 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/CreateEmailSignInUrlResponseProperties.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/CreateEmailSignInUrlResponseProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,7 +55,15 @@ public partial class CreateEmailSignInUrlResponseProperties 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,13 +78,13 @@ internal CreateEmailSignInUrlResponseProperties(global::System.Collections.IDict // actually deserialize if (content.Contains("Url")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICreateEmailSignInUrlResponsePropertiesInternal)this).Url = (string) content.GetValueForProperty("Url",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICreateEmailSignInUrlResponsePropertiesInternal)this).Url, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICreateEmailSignInUrlResponsePropertiesInternal)this).Url = (string) content.GetValueForProperty("Url",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICreateEmailSignInUrlResponsePropertiesInternal)this).Url, 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. @@ -91,35 +99,35 @@ internal CreateEmailSignInUrlResponseProperties(global::System.Management.Automa // actually deserialize if (content.Contains("Url")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICreateEmailSignInUrlResponsePropertiesInternal)this).Url = (string) content.GetValueForProperty("Url",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICreateEmailSignInUrlResponsePropertiesInternal)this).Url, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICreateEmailSignInUrlResponsePropertiesInternal)this).Url = (string) content.GetValueForProperty("Url",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICreateEmailSignInUrlResponsePropertiesInternal)this).Url, 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.BotService.Models.Api20220615Preview.ICreateEmailSignInUrlResponseProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICreateEmailSignInUrlResponseProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new CreateEmailSignInUrlResponseProperties(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.BotService.Models.Api20220615Preview.ICreateEmailSignInUrlResponseProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICreateEmailSignInUrlResponseProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new CreateEmailSignInUrlResponseProperties(content); } @@ -132,12 +140,24 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Pr /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICreateEmailSignInUrlResponseProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICreateEmailSignInUrlResponseProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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 set of properties specific to sign in url [System.ComponentModel.TypeConverter(typeof(CreateEmailSignInUrlResponsePropertiesTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/CreateEmailSignInUrlResponseProperties.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/CreateEmailSignInUrlResponseProperties.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/CreateEmailSignInUrlResponseProperties.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/CreateEmailSignInUrlResponseProperties.TypeConverter.cs index 66322b7206d7..0913483f56a4 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/CreateEmailSignInUrlResponseProperties.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/CreateEmailSignInUrlResponseProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.ICreateEmailSignInUrlResponseProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICreateEmailSignInUrlResponseProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICreateEmailSignInUrlResponseProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICreateEmailSignInUrlResponseProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/CreateEmailSignInUrlResponseProperties.cs b/generated/BotService/BotService.Autorest/generated/api/Models/CreateEmailSignInUrlResponseProperties.cs similarity index 84% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/CreateEmailSignInUrlResponseProperties.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/CreateEmailSignInUrlResponseProperties.cs index 2c45a2826a66..b9504bbc2994 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/CreateEmailSignInUrlResponseProperties.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/CreateEmailSignInUrlResponseProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// The set of properties specific to sign in url public partial class CreateEmailSignInUrlResponseProperties : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICreateEmailSignInUrlResponseProperties, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICreateEmailSignInUrlResponsePropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICreateEmailSignInUrlResponseProperties, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICreateEmailSignInUrlResponsePropertiesInternal { /// Backing field for property. @@ -34,6 +34,9 @@ public partial interface ICreateEmailSignInUrlResponseProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Sign in url.", SerializedName = @"url", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/CreateEmailSignInUrlResponseProperties.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/CreateEmailSignInUrlResponseProperties.json.cs similarity index 93% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/CreateEmailSignInUrlResponseProperties.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/CreateEmailSignInUrlResponseProperties.json.cs index 8d1c0c2c5f13..233502afe4b6 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/CreateEmailSignInUrlResponseProperties.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/CreateEmailSignInUrlResponseProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -65,18 +65,18 @@ internal CreateEmailSignInUrlResponseProperties(Microsoft.Azure.PowerShell.Cmdle { return; } - {_url = If( json?.PropertyT("url"), out var __jsonUrl) ? (string)__jsonUrl : (string)Url;} + {_url = If( json?.PropertyT("url"), out var __jsonUrl) ? (string)__jsonUrl : (string)_url;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICreateEmailSignInUrlResponseProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICreateEmailSignInUrlResponseProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICreateEmailSignInUrlResponseProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICreateEmailSignInUrlResponseProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICreateEmailSignInUrlResponseProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICreateEmailSignInUrlResponseProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new CreateEmailSignInUrlResponseProperties(json) : null; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/DirectLineChannel.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/DirectLineChannel.PowerShell.cs similarity index 57% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/DirectLineChannel.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/DirectLineChannel.PowerShell.cs index e7f5ecd970c9..199393f3bf14 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/DirectLineChannel.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/DirectLineChannel.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,35 +55,41 @@ public partial class DirectLineChannel 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.BotService.Models.Api20220615Preview.IDirectLineChannel DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannel DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new DirectLineChannel(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.BotService.Models.Api20220615Preview.IDirectLineChannel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new DirectLineChannel(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -98,45 +104,45 @@ internal DirectLineChannel(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannelProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.DirectLineChannelPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.DirectLineChannelPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Etag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Etag, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Etag, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).ProvisioningState, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("Site")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannelInternal)this).Site = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISite[]) content.GetValueForProperty("Site",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannelInternal)this).Site, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SiteTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelInternal)this).Site = (System.Collections.Generic.List) content.GetValueForProperty("Site",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelInternal)this).Site, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.DirectLineSiteTypeConverter.ConvertFrom)); } if (content.Contains("ExtensionKey1")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannelInternal)this).ExtensionKey1 = (string) content.GetValueForProperty("ExtensionKey1",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannelInternal)this).ExtensionKey1, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelInternal)this).ExtensionKey1 = (string) content.GetValueForProperty("ExtensionKey1",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelInternal)this).ExtensionKey1, global::System.Convert.ToString); } if (content.Contains("ExtensionKey2")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannelInternal)this).ExtensionKey2 = (string) content.GetValueForProperty("ExtensionKey2",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannelInternal)this).ExtensionKey2, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelInternal)this).ExtensionKey2 = (string) content.GetValueForProperty("ExtensionKey2",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelInternal)this).ExtensionKey2, global::System.Convert.ToString); } if (content.Contains("DirectLineEmbedCode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannelInternal)this).DirectLineEmbedCode = (string) content.GetValueForProperty("DirectLineEmbedCode",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannelInternal)this).DirectLineEmbedCode, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelInternal)this).DirectLineEmbedCode = (string) content.GetValueForProperty("DirectLineEmbedCode",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelInternal)this).DirectLineEmbedCode, 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. @@ -151,39 +157,39 @@ internal DirectLineChannel(global::System.Management.Automation.PSObject content // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannelProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.DirectLineChannelPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.DirectLineChannelPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Etag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Etag, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Etag, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).ProvisioningState, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("Site")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannelInternal)this).Site = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISite[]) content.GetValueForProperty("Site",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannelInternal)this).Site, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SiteTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelInternal)this).Site = (System.Collections.Generic.List) content.GetValueForProperty("Site",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelInternal)this).Site, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.DirectLineSiteTypeConverter.ConvertFrom)); } if (content.Contains("ExtensionKey1")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannelInternal)this).ExtensionKey1 = (string) content.GetValueForProperty("ExtensionKey1",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannelInternal)this).ExtensionKey1, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelInternal)this).ExtensionKey1 = (string) content.GetValueForProperty("ExtensionKey1",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelInternal)this).ExtensionKey1, global::System.Convert.ToString); } if (content.Contains("ExtensionKey2")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannelInternal)this).ExtensionKey2 = (string) content.GetValueForProperty("ExtensionKey2",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannelInternal)this).ExtensionKey2, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelInternal)this).ExtensionKey2 = (string) content.GetValueForProperty("ExtensionKey2",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelInternal)this).ExtensionKey2, global::System.Convert.ToString); } if (content.Contains("DirectLineEmbedCode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannelInternal)this).DirectLineEmbedCode = (string) content.GetValueForProperty("DirectLineEmbedCode",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannelInternal)this).DirectLineEmbedCode, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelInternal)this).DirectLineEmbedCode = (string) content.GetValueForProperty("DirectLineEmbedCode",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelInternal)this).DirectLineEmbedCode, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -193,12 +199,24 @@ internal DirectLineChannel(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.BotService.Models.Api20220615Preview.IDirectLineChannel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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(); + } } /// Direct Line channel definition [System.ComponentModel.TypeConverter(typeof(DirectLineChannelTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/DirectLineChannel.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/DirectLineChannel.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/DirectLineChannel.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/DirectLineChannel.TypeConverter.cs index 4b44467fec58..8d7a107f0e82 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/DirectLineChannel.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/DirectLineChannel.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IDirectLineChannel ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannel ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannel).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannel).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/DirectLineChannel.cs b/generated/BotService/BotService.Autorest/generated/api/Models/DirectLineChannel.cs similarity index 59% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/DirectLineChannel.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/DirectLineChannel.cs index 345304154cc6..6cd26d64bf44 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/DirectLineChannel.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/DirectLineChannel.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// Direct Line channel definition public partial class DirectLineChannel : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannel, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannelInternal, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannel, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelInternal, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannel __channel = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Channel(); + private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannel __channel = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Channel(); /// Direct Line embed code of the resource [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string DirectLineEmbedCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannelPropertiesInternal)Property).DirectLineEmbedCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannelPropertiesInternal)Property).DirectLineEmbedCode = value ?? null; } + public string DirectLineEmbedCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelPropertiesInternal)Property).DirectLineEmbedCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelPropertiesInternal)Property).DirectLineEmbedCode = value ?? null; } /// Entity Tag of the resource [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Etag = value ?? null; } + public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Etag = value ?? null; } /// The extensionKey1 [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string ExtensionKey1 { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannelPropertiesInternal)Property).ExtensionKey1; } + public string ExtensionKey1 { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelPropertiesInternal)Property).ExtensionKey1; } /// The extensionKey2 [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string ExtensionKey2 { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannelPropertiesInternal)Property).ExtensionKey2; } + public string ExtensionKey2 { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelPropertiesInternal)Property).ExtensionKey2; } /// Specifies the location of the resource. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Location = value ?? null; } + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Location = value ?? null; } /// Internal Acessors for ProvisioningState - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).ProvisioningState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).ProvisioningState = value; } /// Internal Acessors for ExtensionKey1 - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannelInternal.ExtensionKey1 { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannelPropertiesInternal)Property).ExtensionKey1; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannelPropertiesInternal)Property).ExtensionKey1 = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelInternal.ExtensionKey1 { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelPropertiesInternal)Property).ExtensionKey1; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelPropertiesInternal)Property).ExtensionKey1 = value; } /// Internal Acessors for ExtensionKey2 - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannelInternal.ExtensionKey2 { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannelPropertiesInternal)Property).ExtensionKey2; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannelPropertiesInternal)Property).ExtensionKey2 = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelInternal.ExtensionKey2 { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelPropertiesInternal)Property).ExtensionKey2; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelPropertiesInternal)Property).ExtensionKey2 = value; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannelProperties Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannelInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.DirectLineChannelProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelProperties Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.DirectLineChannelProperties()); set { {_property = value;} } } /// The channel name + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Constant] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Name = value ; } + public string Name { get => "DirectLineChannel"; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Name = "DirectLineChannel"; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannelProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelProperties _property; /// The set of properties specific to Direct Line channel resource [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannelProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.DirectLineChannelProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.DirectLineChannelProperties()); set => this._property = value; } /// Provisioning state of the resource [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).ProvisioningState; } + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).ProvisioningState; } /// The list of Direct Line sites [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISite[] Site { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannelPropertiesInternal)Property).Site; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannelPropertiesInternal)Property).Site = value ?? null /* arrayOf */; } + public System.Collections.Generic.List Site { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelPropertiesInternal)Property).Site; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelPropertiesInternal)Property).Site = value ?? null /* arrayOf */; } /// Creates an new instance. public DirectLineChannel() { - + this.__channel.Name = "DirectLineChannel"; } /// Validates that this object meets the validation criteria. @@ -91,12 +91,15 @@ public DirectLineChannel() /// Direct Line channel definition public partial interface IDirectLineChannel : Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannel + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannel { /// Direct Line embed code of the resource [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Direct Line embed code of the resource", SerializedName = @"DirectLineEmbedCode", PossibleTypes = new [] { typeof(string) })] @@ -105,6 +108,9 @@ public partial interface IDirectLineChannel : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The extensionKey1", SerializedName = @"extensionKey1", PossibleTypes = new [] { typeof(string) })] @@ -113,6 +119,9 @@ public partial interface IDirectLineChannel : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The extensionKey2", SerializedName = @"extensionKey2", PossibleTypes = new [] { typeof(string) })] @@ -121,15 +130,18 @@ public partial interface IDirectLineChannel : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of Direct Line sites", SerializedName = @"sites", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISite) })] - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISite[] Site { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSite) })] + System.Collections.Generic.List Site { get; set; } } /// Direct Line channel definition internal partial interface IDirectLineChannelInternal : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal { /// Direct Line embed code of the resource string DirectLineEmbedCode { get; set; } @@ -138,9 +150,9 @@ internal partial interface IDirectLineChannelInternal : /// The extensionKey2 string ExtensionKey2 { get; set; } /// The set of properties specific to Direct Line channel resource - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannelProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelProperties Property { get; set; } /// The list of Direct Line sites - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISite[] Site { get; set; } + System.Collections.Generic.List Site { get; set; } } } \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/DirectLineChannel.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/DirectLineChannel.json.cs similarity index 92% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/DirectLineChannel.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/DirectLineChannel.json.cs index 6161b4f60302..2066f35036bd 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/DirectLineChannel.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/DirectLineChannel.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -65,19 +65,19 @@ internal DirectLineChannel(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime { return; } - __channel = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Channel(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.DirectLineChannelProperties.FromJson(__jsonProperties) : Property;} + __channel = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Channel(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.DirectLineChannelProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannel. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannel. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannel. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannel. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannel FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannel FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new DirectLineChannel(json) : null; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/DirectLineChannelProperties.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/DirectLineChannelProperties.PowerShell.cs similarity index 64% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/DirectLineChannelProperties.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/DirectLineChannelProperties.PowerShell.cs index aa98097463f2..c2f9abdc2b19 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/DirectLineChannelProperties.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/DirectLineChannelProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,35 +55,41 @@ public partial class DirectLineChannelProperties 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.BotService.Models.Api20220615Preview.IDirectLineChannelProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new DirectLineChannelProperties(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.BotService.Models.Api20220615Preview.IDirectLineChannelProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new DirectLineChannelProperties(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 +104,25 @@ internal DirectLineChannelProperties(global::System.Collections.IDictionary cont // actually deserialize if (content.Contains("Site")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannelPropertiesInternal)this).Site = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISite[]) content.GetValueForProperty("Site",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannelPropertiesInternal)this).Site, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SiteTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelPropertiesInternal)this).Site = (System.Collections.Generic.List) content.GetValueForProperty("Site",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelPropertiesInternal)this).Site, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.DirectLineSiteTypeConverter.ConvertFrom)); } if (content.Contains("ExtensionKey1")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannelPropertiesInternal)this).ExtensionKey1 = (string) content.GetValueForProperty("ExtensionKey1",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannelPropertiesInternal)this).ExtensionKey1, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelPropertiesInternal)this).ExtensionKey1 = (string) content.GetValueForProperty("ExtensionKey1",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelPropertiesInternal)this).ExtensionKey1, global::System.Convert.ToString); } if (content.Contains("ExtensionKey2")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannelPropertiesInternal)this).ExtensionKey2 = (string) content.GetValueForProperty("ExtensionKey2",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannelPropertiesInternal)this).ExtensionKey2, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelPropertiesInternal)this).ExtensionKey2 = (string) content.GetValueForProperty("ExtensionKey2",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelPropertiesInternal)this).ExtensionKey2, global::System.Convert.ToString); } if (content.Contains("DirectLineEmbedCode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannelPropertiesInternal)this).DirectLineEmbedCode = (string) content.GetValueForProperty("DirectLineEmbedCode",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannelPropertiesInternal)this).DirectLineEmbedCode, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelPropertiesInternal)this).DirectLineEmbedCode = (string) content.GetValueForProperty("DirectLineEmbedCode",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelPropertiesInternal)this).DirectLineEmbedCode, 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 +137,19 @@ internal DirectLineChannelProperties(global::System.Management.Automation.PSObje // actually deserialize if (content.Contains("Site")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannelPropertiesInternal)this).Site = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISite[]) content.GetValueForProperty("Site",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannelPropertiesInternal)this).Site, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SiteTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelPropertiesInternal)this).Site = (System.Collections.Generic.List) content.GetValueForProperty("Site",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelPropertiesInternal)this).Site, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.DirectLineSiteTypeConverter.ConvertFrom)); } if (content.Contains("ExtensionKey1")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannelPropertiesInternal)this).ExtensionKey1 = (string) content.GetValueForProperty("ExtensionKey1",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannelPropertiesInternal)this).ExtensionKey1, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelPropertiesInternal)this).ExtensionKey1 = (string) content.GetValueForProperty("ExtensionKey1",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelPropertiesInternal)this).ExtensionKey1, global::System.Convert.ToString); } if (content.Contains("ExtensionKey2")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannelPropertiesInternal)this).ExtensionKey2 = (string) content.GetValueForProperty("ExtensionKey2",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannelPropertiesInternal)this).ExtensionKey2, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelPropertiesInternal)this).ExtensionKey2 = (string) content.GetValueForProperty("ExtensionKey2",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelPropertiesInternal)this).ExtensionKey2, global::System.Convert.ToString); } if (content.Contains("DirectLineEmbedCode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannelPropertiesInternal)this).DirectLineEmbedCode = (string) content.GetValueForProperty("DirectLineEmbedCode",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannelPropertiesInternal)this).DirectLineEmbedCode, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelPropertiesInternal)this).DirectLineEmbedCode = (string) content.GetValueForProperty("DirectLineEmbedCode",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelPropertiesInternal)this).DirectLineEmbedCode, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -153,12 +159,24 @@ internal DirectLineChannelProperties(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.BotService.Models.Api20220615Preview.IDirectLineChannelProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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 parameters to provide for the Direct Line channel. [System.ComponentModel.TypeConverter(typeof(DirectLineChannelPropertiesTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/DirectLineChannelProperties.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/DirectLineChannelProperties.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/DirectLineChannelProperties.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/DirectLineChannelProperties.TypeConverter.cs index 9129fa43c505..ee7938abce8f 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/DirectLineChannelProperties.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/DirectLineChannelProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IDirectLineChannelProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannelProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/DirectLineChannelProperties.cs b/generated/BotService/BotService.Autorest/generated/api/Models/DirectLineChannelProperties.cs similarity index 77% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/DirectLineChannelProperties.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/DirectLineChannelProperties.cs index 1c451cf5248a..f467074e2080 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/DirectLineChannelProperties.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/DirectLineChannelProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// The parameters to provide for the Direct Line channel. public partial class DirectLineChannelProperties : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannelProperties, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannelPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelProperties, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelPropertiesInternal { /// Backing field for property. @@ -35,17 +35,17 @@ public partial class DirectLineChannelProperties : public string ExtensionKey2 { get => this._extensionKey2; } /// Internal Acessors for ExtensionKey1 - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannelPropertiesInternal.ExtensionKey1 { get => this._extensionKey1; set { {_extensionKey1 = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelPropertiesInternal.ExtensionKey1 { get => this._extensionKey1; set { {_extensionKey1 = value;} } } /// Internal Acessors for ExtensionKey2 - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannelPropertiesInternal.ExtensionKey2 { get => this._extensionKey2; set { {_extensionKey2 = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelPropertiesInternal.ExtensionKey2 { get => this._extensionKey2; set { {_extensionKey2 = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISite[] _site; + private System.Collections.Generic.List _site; /// The list of Direct Line sites [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISite[] Site { get => this._site; set => this._site = value; } + public System.Collections.Generic.List Site { get => this._site; set => this._site = value; } /// Creates an new instance. public DirectLineChannelProperties() @@ -61,6 +61,9 @@ public partial interface IDirectLineChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Direct Line embed code of the resource", SerializedName = @"DirectLineEmbedCode", PossibleTypes = new [] { typeof(string) })] @@ -69,6 +72,9 @@ public partial interface IDirectLineChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The extensionKey1", SerializedName = @"extensionKey1", PossibleTypes = new [] { typeof(string) })] @@ -77,6 +83,9 @@ public partial interface IDirectLineChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The extensionKey2", SerializedName = @"extensionKey2", PossibleTypes = new [] { typeof(string) })] @@ -85,10 +94,13 @@ public partial interface IDirectLineChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of Direct Line sites", SerializedName = @"sites", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISite) })] - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISite[] Site { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSite) })] + System.Collections.Generic.List Site { get; set; } } /// The parameters to provide for the Direct Line channel. @@ -102,7 +114,7 @@ internal partial interface IDirectLineChannelPropertiesInternal /// The extensionKey2 string ExtensionKey2 { get; set; } /// The list of Direct Line sites - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISite[] Site { get; set; } + System.Collections.Generic.List Site { get; set; } } } \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/DirectLineChannelProperties.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/DirectLineChannelProperties.json.cs similarity index 89% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/DirectLineChannelProperties.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/DirectLineChannelProperties.json.cs index cff02d403b73..1e8b9ca3b8b2 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/DirectLineChannelProperties.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/DirectLineChannelProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -65,21 +65,21 @@ internal DirectLineChannelProperties(Microsoft.Azure.PowerShell.Cmdlets.BotServi { return; } - {_site = If( json?.PropertyT("sites"), out var __jsonSites) ? If( __jsonSites as Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.ISite) (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Site.FromJson(__u) )) ))() : null : Site;} - {_extensionKey1 = If( json?.PropertyT("extensionKey1"), out var __jsonExtensionKey1) ? (string)__jsonExtensionKey1 : (string)ExtensionKey1;} - {_extensionKey2 = If( json?.PropertyT("extensionKey2"), out var __jsonExtensionKey2) ? (string)__jsonExtensionKey2 : (string)ExtensionKey2;} - {_directLineEmbedCode = If( json?.PropertyT("DirectLineEmbedCode"), out var __jsonDirectLineEmbedCode) ? (string)__jsonDirectLineEmbedCode : (string)DirectLineEmbedCode;} + {_site = If( json?.PropertyT("sites"), out var __jsonSites) ? If( __jsonSites as Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.IDirectLineSite) (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.DirectLineSite.FromJson(__u) )) ))() : null : _site;} + {_extensionKey1 = If( json?.PropertyT("extensionKey1"), out var __jsonExtensionKey1) ? (string)__jsonExtensionKey1 : (string)_extensionKey1;} + {_extensionKey2 = If( json?.PropertyT("extensionKey2"), out var __jsonExtensionKey2) ? (string)__jsonExtensionKey2 : (string)_extensionKey2;} + {_directLineEmbedCode = If( json?.PropertyT("DirectLineEmbedCode"), out var __jsonDirectLineEmbedCode) ? (string)__jsonDirectLineEmbedCode : (string)_directLineEmbedCode;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannelProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannelProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineChannelProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineChannelProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new DirectLineChannelProperties(json) : null; } @@ -112,11 +112,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode ToJso } container.Add("sites",__w); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._extensionKey1)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._extensionKey1.ToString()) : null, "extensionKey1" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._extensionKey2)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._extensionKey2.ToString()) : null, "extensionKey2" ,container.Add ); } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/DirectLineSite.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/DirectLineSite.PowerShell.cs similarity index 52% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/DirectLineSite.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/DirectLineSite.PowerShell.cs index 5550e76f4915..15f88e9b243d 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/DirectLineSite.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/DirectLineSite.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,33 +55,41 @@ public partial class DirectLineSite 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.BotService.Models.Api20220615Preview.IDirectLineSite DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSite DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new DirectLineSite(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.BotService.Models.Api20220615Preview.IDirectLineSite DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSite DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new DirectLineSite(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -96,77 +104,77 @@ internal DirectLineSite(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Key")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).Key, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).Key, global::System.Convert.ToString); } if (content.Contains("Key2")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).Key2 = (string) content.GetValueForProperty("Key2",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).Key2, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).Key2 = (string) content.GetValueForProperty("Key2",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).Key2, global::System.Convert.ToString); } if (content.Contains("IsEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsTokenEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsTokenEnabled = (bool?) content.GetValueForProperty("IsTokenEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsTokenEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsTokenEnabled = (bool?) content.GetValueForProperty("IsTokenEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsTokenEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsEndpointParametersEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsEndpointParametersEnabled = (bool?) content.GetValueForProperty("IsEndpointParametersEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsEndpointParametersEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsEndpointParametersEnabled = (bool?) content.GetValueForProperty("IsEndpointParametersEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsEndpointParametersEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsDetailedLoggingEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsDetailedLoggingEnabled = (bool?) content.GetValueForProperty("IsDetailedLoggingEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsDetailedLoggingEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsDetailedLoggingEnabled = (bool?) content.GetValueForProperty("IsDetailedLoggingEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsDetailedLoggingEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsBlockUserUploadEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsBlockUserUploadEnabled = (bool?) content.GetValueForProperty("IsBlockUserUploadEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsBlockUserUploadEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsBlockUserUploadEnabled = (bool?) content.GetValueForProperty("IsBlockUserUploadEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsBlockUserUploadEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsNoStorageEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsNoStorageEnabled = (bool?) content.GetValueForProperty("IsNoStorageEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsNoStorageEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsNoStorageEnabled = (bool?) content.GetValueForProperty("IsNoStorageEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsNoStorageEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("ETag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).ETag, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).ETag, global::System.Convert.ToString); } if (content.Contains("AppId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).AppId = (string) content.GetValueForProperty("AppId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).AppId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).AppId = (string) content.GetValueForProperty("AppId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).AppId, global::System.Convert.ToString); } if (content.Contains("IsV1Enabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsV1Enabled = (bool?) content.GetValueForProperty("IsV1Enabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsV1Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsV1Enabled = (bool?) content.GetValueForProperty("IsV1Enabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsV1Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsV3Enabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsV3Enabled = (bool?) content.GetValueForProperty("IsV3Enabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsV3Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsV3Enabled = (bool?) content.GetValueForProperty("IsV3Enabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsV3Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsSecureSiteEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsSecureSiteEnabled = (bool?) content.GetValueForProperty("IsSecureSiteEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsSecureSiteEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsSecureSiteEnabled = (bool?) content.GetValueForProperty("IsSecureSiteEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsSecureSiteEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("TrustedOrigin")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).TrustedOrigin = (string[]) content.GetValueForProperty("TrustedOrigin",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).TrustedOrigin, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).TrustedOrigin = (System.Collections.Generic.List) content.GetValueForProperty("TrustedOrigin",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).TrustedOrigin, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("IsWebchatPreviewEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsWebchatPreviewEnabled = (bool?) content.GetValueForProperty("IsWebchatPreviewEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsWebchatPreviewEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsWebchatPreviewEnabled = (bool?) content.GetValueForProperty("IsWebchatPreviewEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsWebchatPreviewEnabled, (__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. @@ -181,71 +189,71 @@ internal DirectLineSite(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Key")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).Key, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).Key, global::System.Convert.ToString); } if (content.Contains("Key2")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).Key2 = (string) content.GetValueForProperty("Key2",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).Key2, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).Key2 = (string) content.GetValueForProperty("Key2",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).Key2, global::System.Convert.ToString); } if (content.Contains("IsEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsTokenEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsTokenEnabled = (bool?) content.GetValueForProperty("IsTokenEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsTokenEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsTokenEnabled = (bool?) content.GetValueForProperty("IsTokenEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsTokenEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsEndpointParametersEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsEndpointParametersEnabled = (bool?) content.GetValueForProperty("IsEndpointParametersEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsEndpointParametersEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsEndpointParametersEnabled = (bool?) content.GetValueForProperty("IsEndpointParametersEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsEndpointParametersEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsDetailedLoggingEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsDetailedLoggingEnabled = (bool?) content.GetValueForProperty("IsDetailedLoggingEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsDetailedLoggingEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsDetailedLoggingEnabled = (bool?) content.GetValueForProperty("IsDetailedLoggingEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsDetailedLoggingEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsBlockUserUploadEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsBlockUserUploadEnabled = (bool?) content.GetValueForProperty("IsBlockUserUploadEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsBlockUserUploadEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsBlockUserUploadEnabled = (bool?) content.GetValueForProperty("IsBlockUserUploadEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsBlockUserUploadEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsNoStorageEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsNoStorageEnabled = (bool?) content.GetValueForProperty("IsNoStorageEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsNoStorageEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsNoStorageEnabled = (bool?) content.GetValueForProperty("IsNoStorageEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsNoStorageEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("ETag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).ETag, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).ETag, global::System.Convert.ToString); } if (content.Contains("AppId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).AppId = (string) content.GetValueForProperty("AppId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).AppId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).AppId = (string) content.GetValueForProperty("AppId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).AppId, global::System.Convert.ToString); } if (content.Contains("IsV1Enabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsV1Enabled = (bool?) content.GetValueForProperty("IsV1Enabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsV1Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsV1Enabled = (bool?) content.GetValueForProperty("IsV1Enabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsV1Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsV3Enabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsV3Enabled = (bool?) content.GetValueForProperty("IsV3Enabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsV3Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsV3Enabled = (bool?) content.GetValueForProperty("IsV3Enabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsV3Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsSecureSiteEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsSecureSiteEnabled = (bool?) content.GetValueForProperty("IsSecureSiteEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsSecureSiteEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsSecureSiteEnabled = (bool?) content.GetValueForProperty("IsSecureSiteEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsSecureSiteEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("TrustedOrigin")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).TrustedOrigin = (string[]) content.GetValueForProperty("TrustedOrigin",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).TrustedOrigin, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).TrustedOrigin = (System.Collections.Generic.List) content.GetValueForProperty("TrustedOrigin",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).TrustedOrigin, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("IsWebchatPreviewEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsWebchatPreviewEnabled = (bool?) content.GetValueForProperty("IsWebchatPreviewEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsWebchatPreviewEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsWebchatPreviewEnabled = (bool?) content.GetValueForProperty("IsWebchatPreviewEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsWebchatPreviewEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializePSObject(content); } @@ -255,12 +263,24 @@ internal DirectLineSite(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.BotService.Models.Api20220615Preview.IDirectLineSite FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSite FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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 site for the Direct Line channel [System.ComponentModel.TypeConverter(typeof(DirectLineSiteTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/DirectLineSite.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/DirectLineSite.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/DirectLineSite.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/DirectLineSite.TypeConverter.cs index c8a733eff7d7..aea8dbd138b3 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/DirectLineSite.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/DirectLineSite.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IDirectLineSite ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSite ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSite).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSite).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/DirectLineSite.cs b/generated/BotService/BotService.Autorest/generated/api/Models/DirectLineSite.cs similarity index 58% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/DirectLineSite.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/DirectLineSite.cs index fca064a6311d..a58be946017b 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/DirectLineSite.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/DirectLineSite.cs @@ -3,107 +3,106 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// A site for the Direct Line channel public partial class DirectLineSite : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSite, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSiteInternal, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSite, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSiteInternal, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISite __site = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Site(); + private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISite __site = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Site(); /// DirectLine application id [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string AppId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).AppId; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).AppId = value ?? null; } + public string AppId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).AppId; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).AppId = value ?? null; } /// Entity Tag [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string ETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).ETag; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).ETag = value ?? null; } + public string ETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).ETag; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).ETag = value ?? null; } /// Site Id [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).Id; } /// Whether this site is enabled for block user upload. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public bool? IsBlockUserUploadEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).IsBlockUserUploadEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).IsBlockUserUploadEnabled = value ?? default(bool); } + public bool? IsBlockUserUploadEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).IsBlockUserUploadEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).IsBlockUserUploadEnabled = value ?? default(bool); } /// Whether this site is disabled detailed logging for [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public bool? IsDetailedLoggingEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).IsDetailedLoggingEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).IsDetailedLoggingEnabled = value ?? default(bool); } + public bool? IsDetailedLoggingEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).IsDetailedLoggingEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).IsDetailedLoggingEnabled = value ?? default(bool); } /// Whether this site is enabled for DirectLine channel [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public bool IsEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).IsEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).IsEnabled = value ; } + public bool IsEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).IsEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).IsEnabled = value ; } /// Whether this site is EndpointParameters enabled for channel [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public bool? IsEndpointParametersEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).IsEndpointParametersEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).IsEndpointParametersEnabled = value ?? default(bool); } + public bool? IsEndpointParametersEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).IsEndpointParametersEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).IsEndpointParametersEnabled = value ?? default(bool); } /// Whether this no-storage site is disabled detailed logging for [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public bool? IsNoStorageEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).IsNoStorageEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).IsNoStorageEnabled = value ?? default(bool); } + public bool? IsNoStorageEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).IsNoStorageEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).IsNoStorageEnabled = value ?? default(bool); } /// Whether this site is enabled for authentication with Bot Framework. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public bool? IsSecureSiteEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).IsSecureSiteEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).IsSecureSiteEnabled = value ?? default(bool); } + public bool? IsSecureSiteEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).IsSecureSiteEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).IsSecureSiteEnabled = value ?? default(bool); } /// Whether this site is token enabled for channel [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public bool? IsTokenEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).IsTokenEnabled; } + public bool? IsTokenEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).IsTokenEnabled; } /// Whether this site is enabled for Bot Framework V1 protocol. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public bool? IsV1Enabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).IsV1Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).IsV1Enabled = value ?? default(bool); } + public bool? IsV1Enabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).IsV1Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).IsV1Enabled = value ?? default(bool); } /// Whether this site is enabled for Bot Framework V1 protocol. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public bool? IsV3Enabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).IsV3Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).IsV3Enabled = value ?? default(bool); } + public bool? IsV3Enabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).IsV3Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).IsV3Enabled = value ?? default(bool); } /// Whether this site is enabled for preview versions of Webchat [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public bool? IsWebchatPreviewEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).IsWebchatPreviewEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).IsWebchatPreviewEnabled = value ?? default(bool); } + public bool? IsWebchatPreviewEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).IsWebchatPreviewEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).IsWebchatPreviewEnabled = value ?? default(bool); } /// /// Primary key. Value only returned through POST to the action Channel List API, otherwise empty. /// [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Key { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).Key; } + public string Key { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).Key; } /// /// Secondary key. Value only returned through POST to the action Channel List API, otherwise empty. /// [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Key2 { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).Key2; } + public string Key2 { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).Key2; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).Id = value; } /// Internal Acessors for IsTokenEnabled - bool? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal.IsTokenEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).IsTokenEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).IsTokenEnabled = value; } + bool? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal.IsTokenEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).IsTokenEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).IsTokenEnabled = value; } /// Internal Acessors for Key - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal.Key { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).Key; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).Key = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal.Key { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).Key; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).Key = value; } /// Internal Acessors for Key2 - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal.Key2 { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).Key2; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).Key2 = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal.Key2 { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).Key2; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).Key2 = value; } /// Site name [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).Name = value ; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).Name = value ; } /// /// List of Trusted Origin URLs for this site. This field is applicable only if isSecureSiteEnabled is True. /// [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string[] TrustedOrigin { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).TrustedOrigin; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).TrustedOrigin = value ?? null /* arrayOf */; } + public System.Collections.Generic.List TrustedOrigin { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).TrustedOrigin; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).TrustedOrigin = value ?? null /* arrayOf */; } /// Creates an new instance. public DirectLineSite() @@ -126,13 +125,13 @@ public DirectLineSite() /// A site for the Direct Line channel public partial interface IDirectLineSite : Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISite + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISite { } /// A site for the Direct Line channel internal partial interface IDirectLineSiteInternal : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal { } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/DirectLineSite.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/DirectLineSite.json.cs similarity index 94% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/DirectLineSite.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/DirectLineSite.json.cs index e06676419588..b71bfcf7329e 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/DirectLineSite.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/DirectLineSite.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -65,18 +65,18 @@ internal DirectLineSite(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Js { return; } - __site = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Site(json); + __site = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Site(json); AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSite. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSite. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSite. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSite. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSite FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSite FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new DirectLineSite(json) : null; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/DirectLineSpeechChannel.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/DirectLineSpeechChannel.PowerShell.cs similarity index 54% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/DirectLineSpeechChannel.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/DirectLineSpeechChannel.PowerShell.cs index bceecd0715b4..239b0144b60e 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/DirectLineSpeechChannel.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/DirectLineSpeechChannel.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,35 +55,41 @@ public partial class DirectLineSpeechChannel 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.BotService.Models.Api20220615Preview.IDirectLineSpeechChannel DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannel DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new DirectLineSpeechChannel(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.BotService.Models.Api20220615Preview.IDirectLineSpeechChannel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new DirectLineSpeechChannel(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -98,57 +104,57 @@ internal DirectLineSpeechChannel(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.DirectLineSpeechChannelPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.DirectLineSpeechChannelPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Etag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Etag, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Etag, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).ProvisioningState, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("CognitiveServiceResourceId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelInternal)this).CognitiveServiceResourceId = (string) content.GetValueForProperty("CognitiveServiceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelInternal)this).CognitiveServiceResourceId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelInternal)this).CognitiveServiceResourceId = (string) content.GetValueForProperty("CognitiveServiceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelInternal)this).CognitiveServiceResourceId, global::System.Convert.ToString); } if (content.Contains("CognitiveServiceRegion")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelInternal)this).CognitiveServiceRegion = (string) content.GetValueForProperty("CognitiveServiceRegion",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelInternal)this).CognitiveServiceRegion, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelInternal)this).CognitiveServiceRegion = (string) content.GetValueForProperty("CognitiveServiceRegion",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelInternal)this).CognitiveServiceRegion, global::System.Convert.ToString); } if (content.Contains("CognitiveServiceSubscriptionKey")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelInternal)this).CognitiveServiceSubscriptionKey = (string) content.GetValueForProperty("CognitiveServiceSubscriptionKey",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelInternal)this).CognitiveServiceSubscriptionKey, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelInternal)this).CognitiveServiceSubscriptionKey = (string) content.GetValueForProperty("CognitiveServiceSubscriptionKey",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelInternal)this).CognitiveServiceSubscriptionKey, global::System.Convert.ToString); } if (content.Contains("IsEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelInternal)this).IsEnabled = (bool?) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelInternal)this).IsEnabled = (bool?) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("CustomVoiceDeploymentId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelInternal)this).CustomVoiceDeploymentId = (string) content.GetValueForProperty("CustomVoiceDeploymentId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelInternal)this).CustomVoiceDeploymentId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelInternal)this).CustomVoiceDeploymentId = (string) content.GetValueForProperty("CustomVoiceDeploymentId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelInternal)this).CustomVoiceDeploymentId, global::System.Convert.ToString); } if (content.Contains("CustomSpeechModelId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelInternal)this).CustomSpeechModelId = (string) content.GetValueForProperty("CustomSpeechModelId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelInternal)this).CustomSpeechModelId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelInternal)this).CustomSpeechModelId = (string) content.GetValueForProperty("CustomSpeechModelId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelInternal)this).CustomSpeechModelId, global::System.Convert.ToString); } if (content.Contains("IsDefaultBotForCogSvcAccount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelInternal)this).IsDefaultBotForCogSvcAccount = (bool?) content.GetValueForProperty("IsDefaultBotForCogSvcAccount",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelInternal)this).IsDefaultBotForCogSvcAccount, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelInternal)this).IsDefaultBotForCogSvcAccount = (bool?) content.GetValueForProperty("IsDefaultBotForCogSvcAccount",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelInternal)this).IsDefaultBotForCogSvcAccount, (__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. @@ -163,51 +169,51 @@ internal DirectLineSpeechChannel(global::System.Management.Automation.PSObject c // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.DirectLineSpeechChannelPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.DirectLineSpeechChannelPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Etag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Etag, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Etag, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).ProvisioningState, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("CognitiveServiceResourceId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelInternal)this).CognitiveServiceResourceId = (string) content.GetValueForProperty("CognitiveServiceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelInternal)this).CognitiveServiceResourceId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelInternal)this).CognitiveServiceResourceId = (string) content.GetValueForProperty("CognitiveServiceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelInternal)this).CognitiveServiceResourceId, global::System.Convert.ToString); } if (content.Contains("CognitiveServiceRegion")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelInternal)this).CognitiveServiceRegion = (string) content.GetValueForProperty("CognitiveServiceRegion",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelInternal)this).CognitiveServiceRegion, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelInternal)this).CognitiveServiceRegion = (string) content.GetValueForProperty("CognitiveServiceRegion",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelInternal)this).CognitiveServiceRegion, global::System.Convert.ToString); } if (content.Contains("CognitiveServiceSubscriptionKey")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelInternal)this).CognitiveServiceSubscriptionKey = (string) content.GetValueForProperty("CognitiveServiceSubscriptionKey",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelInternal)this).CognitiveServiceSubscriptionKey, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelInternal)this).CognitiveServiceSubscriptionKey = (string) content.GetValueForProperty("CognitiveServiceSubscriptionKey",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelInternal)this).CognitiveServiceSubscriptionKey, global::System.Convert.ToString); } if (content.Contains("IsEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelInternal)this).IsEnabled = (bool?) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelInternal)this).IsEnabled = (bool?) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("CustomVoiceDeploymentId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelInternal)this).CustomVoiceDeploymentId = (string) content.GetValueForProperty("CustomVoiceDeploymentId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelInternal)this).CustomVoiceDeploymentId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelInternal)this).CustomVoiceDeploymentId = (string) content.GetValueForProperty("CustomVoiceDeploymentId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelInternal)this).CustomVoiceDeploymentId, global::System.Convert.ToString); } if (content.Contains("CustomSpeechModelId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelInternal)this).CustomSpeechModelId = (string) content.GetValueForProperty("CustomSpeechModelId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelInternal)this).CustomSpeechModelId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelInternal)this).CustomSpeechModelId = (string) content.GetValueForProperty("CustomSpeechModelId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelInternal)this).CustomSpeechModelId, global::System.Convert.ToString); } if (content.Contains("IsDefaultBotForCogSvcAccount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelInternal)this).IsDefaultBotForCogSvcAccount = (bool?) content.GetValueForProperty("IsDefaultBotForCogSvcAccount",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelInternal)this).IsDefaultBotForCogSvcAccount, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelInternal)this).IsDefaultBotForCogSvcAccount = (bool?) content.GetValueForProperty("IsDefaultBotForCogSvcAccount",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelInternal)this).IsDefaultBotForCogSvcAccount, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializePSObject(content); } @@ -217,12 +223,24 @@ internal DirectLineSpeechChannel(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.BotService.Models.Api20220615Preview.IDirectLineSpeechChannel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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(); + } } /// DirectLine Speech channel definition [System.ComponentModel.TypeConverter(typeof(DirectLineSpeechChannelTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/DirectLineSpeechChannel.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/DirectLineSpeechChannel.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/DirectLineSpeechChannel.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/DirectLineSpeechChannel.TypeConverter.cs index 9cb0635630c2..40acdbe05b43 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/DirectLineSpeechChannel.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/DirectLineSpeechChannel.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IDirectLineSpeechChannel ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannel ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannel).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannel).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/DirectLineSpeechChannel.cs b/generated/BotService/BotService.Autorest/generated/api/Models/DirectLineSpeechChannel.cs similarity index 66% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/DirectLineSpeechChannel.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/DirectLineSpeechChannel.cs index 672f560716e9..cae5ea1b722b 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/DirectLineSpeechChannel.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/DirectLineSpeechChannel.cs @@ -3,83 +3,83 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// DirectLine Speech channel definition public partial class DirectLineSpeechChannel : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannel, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelInternal, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannel, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelInternal, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannel __channel = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Channel(); + private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannel __channel = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Channel(); /// The cognitive service region with this channel registration. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string CognitiveServiceRegion { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelPropertiesInternal)Property).CognitiveServiceRegion; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelPropertiesInternal)Property).CognitiveServiceRegion = value ?? null; } + public string CognitiveServiceRegion { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelPropertiesInternal)Property).CognitiveServiceRegion; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelPropertiesInternal)Property).CognitiveServiceRegion = value ?? null; } /// The cognitive service id with this channel registration. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string CognitiveServiceResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelPropertiesInternal)Property).CognitiveServiceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelPropertiesInternal)Property).CognitiveServiceResourceId = value ?? null; } + public string CognitiveServiceResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelPropertiesInternal)Property).CognitiveServiceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelPropertiesInternal)Property).CognitiveServiceResourceId = value ?? null; } /// The cognitive service subscription key to use with this channel registration. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string CognitiveServiceSubscriptionKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelPropertiesInternal)Property).CognitiveServiceSubscriptionKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelPropertiesInternal)Property).CognitiveServiceSubscriptionKey = value ?? null; } + public string CognitiveServiceSubscriptionKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelPropertiesInternal)Property).CognitiveServiceSubscriptionKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelPropertiesInternal)Property).CognitiveServiceSubscriptionKey = value ?? null; } /// Custom voice deployment id (optional). [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string CustomSpeechModelId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelPropertiesInternal)Property).CustomSpeechModelId; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelPropertiesInternal)Property).CustomSpeechModelId = value ?? null; } + public string CustomSpeechModelId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelPropertiesInternal)Property).CustomSpeechModelId; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelPropertiesInternal)Property).CustomSpeechModelId = value ?? null; } /// Custom speech model id (optional). [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string CustomVoiceDeploymentId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelPropertiesInternal)Property).CustomVoiceDeploymentId; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelPropertiesInternal)Property).CustomVoiceDeploymentId = value ?? null; } + public string CustomVoiceDeploymentId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelPropertiesInternal)Property).CustomVoiceDeploymentId; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelPropertiesInternal)Property).CustomVoiceDeploymentId = value ?? null; } /// Entity Tag of the resource [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Etag = value ?? null; } + public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Etag = value ?? null; } /// Make this a default bot for chosen cognitive service account. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public bool? IsDefaultBotForCogSvcAccount { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelPropertiesInternal)Property).IsDefaultBotForCogSvcAccount; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelPropertiesInternal)Property).IsDefaultBotForCogSvcAccount = value ?? default(bool); } + public bool? IsDefaultBotForCogSvcAccount { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelPropertiesInternal)Property).IsDefaultBotForCogSvcAccount; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelPropertiesInternal)Property).IsDefaultBotForCogSvcAccount = value ?? default(bool); } /// Whether this channel is enabled or not. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public bool? IsEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelPropertiesInternal)Property).IsEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelPropertiesInternal)Property).IsEnabled = value ?? default(bool); } + public bool? IsEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelPropertiesInternal)Property).IsEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelPropertiesInternal)Property).IsEnabled = value ?? default(bool); } /// Specifies the location of the resource. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Location = value ?? null; } + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Location = value ?? null; } /// Internal Acessors for ProvisioningState - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).ProvisioningState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).ProvisioningState = value; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelProperties Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.DirectLineSpeechChannelProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelProperties Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.DirectLineSpeechChannelProperties()); set { {_property = value;} } } /// The channel name + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Constant] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Name = value ; } + public string Name { get => "DirectLineSpeechChannel"; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Name = "DirectLineSpeechChannel"; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelProperties _property; /// The set of properties specific to DirectLine Speech channel resource [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.DirectLineSpeechChannelProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.DirectLineSpeechChannelProperties()); set => this._property = value; } /// Provisioning state of the resource [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).ProvisioningState; } + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).ProvisioningState; } /// Creates an new instance. public DirectLineSpeechChannel() { - + this.__channel.Name = "DirectLineSpeechChannel"; } /// Validates that this object meets the validation criteria. @@ -97,12 +97,15 @@ public DirectLineSpeechChannel() /// DirectLine Speech channel definition public partial interface IDirectLineSpeechChannel : Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannel + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannel { /// The cognitive service region with this channel registration. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The cognitive service region with this channel registration.", SerializedName = @"cognitiveServiceRegion", PossibleTypes = new [] { typeof(string) })] @@ -111,6 +114,9 @@ public partial interface IDirectLineSpeechChannel : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The cognitive service id with this channel registration.", SerializedName = @"cognitiveServiceResourceId", PossibleTypes = new [] { typeof(string) })] @@ -119,6 +125,9 @@ public partial interface IDirectLineSpeechChannel : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The cognitive service subscription key to use with this channel registration.", SerializedName = @"cognitiveServiceSubscriptionKey", PossibleTypes = new [] { typeof(string) })] @@ -127,6 +136,9 @@ public partial interface IDirectLineSpeechChannel : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Custom voice deployment id (optional).", SerializedName = @"customSpeechModelId", PossibleTypes = new [] { typeof(string) })] @@ -135,6 +147,9 @@ public partial interface IDirectLineSpeechChannel : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Custom speech model id (optional).", SerializedName = @"customVoiceDeploymentId", PossibleTypes = new [] { typeof(string) })] @@ -143,6 +158,9 @@ public partial interface IDirectLineSpeechChannel : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Make this a default bot for chosen cognitive service account.", SerializedName = @"isDefaultBotForCogSvcAccount", PossibleTypes = new [] { typeof(bool) })] @@ -151,6 +169,9 @@ public partial interface IDirectLineSpeechChannel : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Whether this channel is enabled or not.", SerializedName = @"isEnabled", PossibleTypes = new [] { typeof(bool) })] @@ -159,7 +180,7 @@ public partial interface IDirectLineSpeechChannel : } /// DirectLine Speech channel definition internal partial interface IDirectLineSpeechChannelInternal : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal { /// The cognitive service region with this channel registration. string CognitiveServiceRegion { get; set; } @@ -176,7 +197,7 @@ internal partial interface IDirectLineSpeechChannelInternal : /// Whether this channel is enabled or not. bool? IsEnabled { get; set; } /// The set of properties specific to DirectLine Speech channel resource - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelProperties Property { get; set; } } } \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/DirectLineSpeechChannel.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/DirectLineSpeechChannel.json.cs similarity index 92% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/DirectLineSpeechChannel.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/DirectLineSpeechChannel.json.cs index 2b1b39ccc69e..fa9706d2e68d 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/DirectLineSpeechChannel.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/DirectLineSpeechChannel.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -65,19 +65,19 @@ internal DirectLineSpeechChannel(Microsoft.Azure.PowerShell.Cmdlets.BotService.R { return; } - __channel = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Channel(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.DirectLineSpeechChannelProperties.FromJson(__jsonProperties) : Property;} + __channel = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Channel(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.DirectLineSpeechChannelProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannel. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannel. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannel. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannel. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannel FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannel FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new DirectLineSpeechChannel(json) : null; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/DirectLineSpeechChannelProperties.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/DirectLineSpeechChannelProperties.PowerShell.cs similarity index 59% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/DirectLineSpeechChannelProperties.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/DirectLineSpeechChannelProperties.PowerShell.cs index 1ddee4486cea..da6a1a9b83e5 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/DirectLineSpeechChannelProperties.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/DirectLineSpeechChannelProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,35 +55,41 @@ public partial class DirectLineSpeechChannelProperties 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.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new DirectLineSpeechChannelProperties(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.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new DirectLineSpeechChannelProperties(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -98,37 +104,37 @@ internal DirectLineSpeechChannelProperties(global::System.Collections.IDictionar // actually deserialize if (content.Contains("CognitiveServiceResourceId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelPropertiesInternal)this).CognitiveServiceResourceId = (string) content.GetValueForProperty("CognitiveServiceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelPropertiesInternal)this).CognitiveServiceResourceId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelPropertiesInternal)this).CognitiveServiceResourceId = (string) content.GetValueForProperty("CognitiveServiceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelPropertiesInternal)this).CognitiveServiceResourceId, global::System.Convert.ToString); } if (content.Contains("CognitiveServiceRegion")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelPropertiesInternal)this).CognitiveServiceRegion = (string) content.GetValueForProperty("CognitiveServiceRegion",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelPropertiesInternal)this).CognitiveServiceRegion, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelPropertiesInternal)this).CognitiveServiceRegion = (string) content.GetValueForProperty("CognitiveServiceRegion",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelPropertiesInternal)this).CognitiveServiceRegion, global::System.Convert.ToString); } if (content.Contains("CognitiveServiceSubscriptionKey")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelPropertiesInternal)this).CognitiveServiceSubscriptionKey = (string) content.GetValueForProperty("CognitiveServiceSubscriptionKey",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelPropertiesInternal)this).CognitiveServiceSubscriptionKey, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelPropertiesInternal)this).CognitiveServiceSubscriptionKey = (string) content.GetValueForProperty("CognitiveServiceSubscriptionKey",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelPropertiesInternal)this).CognitiveServiceSubscriptionKey, global::System.Convert.ToString); } if (content.Contains("IsEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelPropertiesInternal)this).IsEnabled = (bool?) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelPropertiesInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelPropertiesInternal)this).IsEnabled = (bool?) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelPropertiesInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("CustomVoiceDeploymentId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelPropertiesInternal)this).CustomVoiceDeploymentId = (string) content.GetValueForProperty("CustomVoiceDeploymentId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelPropertiesInternal)this).CustomVoiceDeploymentId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelPropertiesInternal)this).CustomVoiceDeploymentId = (string) content.GetValueForProperty("CustomVoiceDeploymentId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelPropertiesInternal)this).CustomVoiceDeploymentId, global::System.Convert.ToString); } if (content.Contains("CustomSpeechModelId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelPropertiesInternal)this).CustomSpeechModelId = (string) content.GetValueForProperty("CustomSpeechModelId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelPropertiesInternal)this).CustomSpeechModelId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelPropertiesInternal)this).CustomSpeechModelId = (string) content.GetValueForProperty("CustomSpeechModelId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelPropertiesInternal)this).CustomSpeechModelId, global::System.Convert.ToString); } if (content.Contains("IsDefaultBotForCogSvcAccount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelPropertiesInternal)this).IsDefaultBotForCogSvcAccount = (bool?) content.GetValueForProperty("IsDefaultBotForCogSvcAccount",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelPropertiesInternal)this).IsDefaultBotForCogSvcAccount, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelPropertiesInternal)this).IsDefaultBotForCogSvcAccount = (bool?) content.GetValueForProperty("IsDefaultBotForCogSvcAccount",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelPropertiesInternal)this).IsDefaultBotForCogSvcAccount, (__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. @@ -143,31 +149,31 @@ internal DirectLineSpeechChannelProperties(global::System.Management.Automation. // actually deserialize if (content.Contains("CognitiveServiceResourceId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelPropertiesInternal)this).CognitiveServiceResourceId = (string) content.GetValueForProperty("CognitiveServiceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelPropertiesInternal)this).CognitiveServiceResourceId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelPropertiesInternal)this).CognitiveServiceResourceId = (string) content.GetValueForProperty("CognitiveServiceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelPropertiesInternal)this).CognitiveServiceResourceId, global::System.Convert.ToString); } if (content.Contains("CognitiveServiceRegion")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelPropertiesInternal)this).CognitiveServiceRegion = (string) content.GetValueForProperty("CognitiveServiceRegion",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelPropertiesInternal)this).CognitiveServiceRegion, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelPropertiesInternal)this).CognitiveServiceRegion = (string) content.GetValueForProperty("CognitiveServiceRegion",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelPropertiesInternal)this).CognitiveServiceRegion, global::System.Convert.ToString); } if (content.Contains("CognitiveServiceSubscriptionKey")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelPropertiesInternal)this).CognitiveServiceSubscriptionKey = (string) content.GetValueForProperty("CognitiveServiceSubscriptionKey",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelPropertiesInternal)this).CognitiveServiceSubscriptionKey, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelPropertiesInternal)this).CognitiveServiceSubscriptionKey = (string) content.GetValueForProperty("CognitiveServiceSubscriptionKey",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelPropertiesInternal)this).CognitiveServiceSubscriptionKey, global::System.Convert.ToString); } if (content.Contains("IsEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelPropertiesInternal)this).IsEnabled = (bool?) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelPropertiesInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelPropertiesInternal)this).IsEnabled = (bool?) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelPropertiesInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("CustomVoiceDeploymentId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelPropertiesInternal)this).CustomVoiceDeploymentId = (string) content.GetValueForProperty("CustomVoiceDeploymentId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelPropertiesInternal)this).CustomVoiceDeploymentId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelPropertiesInternal)this).CustomVoiceDeploymentId = (string) content.GetValueForProperty("CustomVoiceDeploymentId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelPropertiesInternal)this).CustomVoiceDeploymentId, global::System.Convert.ToString); } if (content.Contains("CustomSpeechModelId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelPropertiesInternal)this).CustomSpeechModelId = (string) content.GetValueForProperty("CustomSpeechModelId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelPropertiesInternal)this).CustomSpeechModelId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelPropertiesInternal)this).CustomSpeechModelId = (string) content.GetValueForProperty("CustomSpeechModelId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelPropertiesInternal)this).CustomSpeechModelId, global::System.Convert.ToString); } if (content.Contains("IsDefaultBotForCogSvcAccount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelPropertiesInternal)this).IsDefaultBotForCogSvcAccount = (bool?) content.GetValueForProperty("IsDefaultBotForCogSvcAccount",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelPropertiesInternal)this).IsDefaultBotForCogSvcAccount, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelPropertiesInternal)this).IsDefaultBotForCogSvcAccount = (bool?) content.GetValueForProperty("IsDefaultBotForCogSvcAccount",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelPropertiesInternal)this).IsDefaultBotForCogSvcAccount, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializePSObject(content); } @@ -179,12 +185,24 @@ internal DirectLineSpeechChannelProperties(global::System.Management.Automation. /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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 parameters to provide for the DirectLine Speech channel. [System.ComponentModel.TypeConverter(typeof(DirectLineSpeechChannelPropertiesTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/DirectLineSpeechChannelProperties.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/DirectLineSpeechChannelProperties.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/DirectLineSpeechChannelProperties.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/DirectLineSpeechChannelProperties.TypeConverter.cs index 67cf27e418d6..25429bd3005a 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/DirectLineSpeechChannelProperties.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/DirectLineSpeechChannelProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/DirectLineSpeechChannelProperties.cs b/generated/BotService/BotService.Autorest/generated/api/Models/DirectLineSpeechChannelProperties.cs similarity index 92% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/DirectLineSpeechChannelProperties.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/DirectLineSpeechChannelProperties.cs index d35b4b51a20f..deaafee1fef5 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/DirectLineSpeechChannelProperties.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/DirectLineSpeechChannelProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// The parameters to provide for the DirectLine Speech channel. public partial class DirectLineSpeechChannelProperties : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelProperties, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelProperties, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelPropertiesInternal { /// Backing field for property. @@ -76,6 +76,9 @@ public partial interface IDirectLineSpeechChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The cognitive service region with this channel registration.", SerializedName = @"cognitiveServiceRegion", PossibleTypes = new [] { typeof(string) })] @@ -84,6 +87,9 @@ public partial interface IDirectLineSpeechChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The cognitive service id with this channel registration.", SerializedName = @"cognitiveServiceResourceId", PossibleTypes = new [] { typeof(string) })] @@ -92,6 +98,9 @@ public partial interface IDirectLineSpeechChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The cognitive service subscription key to use with this channel registration.", SerializedName = @"cognitiveServiceSubscriptionKey", PossibleTypes = new [] { typeof(string) })] @@ -100,6 +109,9 @@ public partial interface IDirectLineSpeechChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Custom voice deployment id (optional).", SerializedName = @"customSpeechModelId", PossibleTypes = new [] { typeof(string) })] @@ -108,6 +120,9 @@ public partial interface IDirectLineSpeechChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Custom speech model id (optional).", SerializedName = @"customVoiceDeploymentId", PossibleTypes = new [] { typeof(string) })] @@ -116,6 +131,9 @@ public partial interface IDirectLineSpeechChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Make this a default bot for chosen cognitive service account.", SerializedName = @"isDefaultBotForCogSvcAccount", PossibleTypes = new [] { typeof(bool) })] @@ -124,6 +142,9 @@ public partial interface IDirectLineSpeechChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Whether this channel is enabled or not.", SerializedName = @"isEnabled", PossibleTypes = new [] { typeof(bool) })] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/DirectLineSpeechChannelProperties.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/DirectLineSpeechChannelProperties.json.cs similarity index 92% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/DirectLineSpeechChannelProperties.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/DirectLineSpeechChannelProperties.json.cs index 79ef8222960e..108d7116bb26 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/DirectLineSpeechChannelProperties.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/DirectLineSpeechChannelProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -65,24 +65,24 @@ internal DirectLineSpeechChannelProperties(Microsoft.Azure.PowerShell.Cmdlets.Bo { return; } - {_cognitiveServiceResourceId = If( json?.PropertyT("cognitiveServiceResourceId"), out var __jsonCognitiveServiceResourceId) ? (string)__jsonCognitiveServiceResourceId : (string)CognitiveServiceResourceId;} - {_cognitiveServiceRegion = If( json?.PropertyT("cognitiveServiceRegion"), out var __jsonCognitiveServiceRegion) ? (string)__jsonCognitiveServiceRegion : (string)CognitiveServiceRegion;} - {_cognitiveServiceSubscriptionKey = If( json?.PropertyT("cognitiveServiceSubscriptionKey"), out var __jsonCognitiveServiceSubscriptionKey) ? (string)__jsonCognitiveServiceSubscriptionKey : (string)CognitiveServiceSubscriptionKey;} - {_isEnabled = If( json?.PropertyT("isEnabled"), out var __jsonIsEnabled) ? (bool?)__jsonIsEnabled : IsEnabled;} - {_customVoiceDeploymentId = If( json?.PropertyT("customVoiceDeploymentId"), out var __jsonCustomVoiceDeploymentId) ? (string)__jsonCustomVoiceDeploymentId : (string)CustomVoiceDeploymentId;} - {_customSpeechModelId = If( json?.PropertyT("customSpeechModelId"), out var __jsonCustomSpeechModelId) ? (string)__jsonCustomSpeechModelId : (string)CustomSpeechModelId;} - {_isDefaultBotForCogSvcAccount = If( json?.PropertyT("isDefaultBotForCogSvcAccount"), out var __jsonIsDefaultBotForCogSvcAccount) ? (bool?)__jsonIsDefaultBotForCogSvcAccount : IsDefaultBotForCogSvcAccount;} + {_cognitiveServiceResourceId = If( json?.PropertyT("cognitiveServiceResourceId"), out var __jsonCognitiveServiceResourceId) ? (string)__jsonCognitiveServiceResourceId : (string)_cognitiveServiceResourceId;} + {_cognitiveServiceRegion = If( json?.PropertyT("cognitiveServiceRegion"), out var __jsonCognitiveServiceRegion) ? (string)__jsonCognitiveServiceRegion : (string)_cognitiveServiceRegion;} + {_cognitiveServiceSubscriptionKey = If( json?.PropertyT("cognitiveServiceSubscriptionKey"), out var __jsonCognitiveServiceSubscriptionKey) ? (string)__jsonCognitiveServiceSubscriptionKey : (string)_cognitiveServiceSubscriptionKey;} + {_isEnabled = If( json?.PropertyT("isEnabled"), out var __jsonIsEnabled) ? (bool?)__jsonIsEnabled : _isEnabled;} + {_customVoiceDeploymentId = If( json?.PropertyT("customVoiceDeploymentId"), out var __jsonCustomVoiceDeploymentId) ? (string)__jsonCustomVoiceDeploymentId : (string)_customVoiceDeploymentId;} + {_customSpeechModelId = If( json?.PropertyT("customSpeechModelId"), out var __jsonCustomSpeechModelId) ? (string)__jsonCustomSpeechModelId : (string)_customSpeechModelId;} + {_isDefaultBotForCogSvcAccount = If( json?.PropertyT("isDefaultBotForCogSvcAccount"), out var __jsonIsDefaultBotForCogSvcAccount) ? (bool?)__jsonIsDefaultBotForCogSvcAccount : _isDefaultBotForCogSvcAccount;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IDirectLineSpeechChannelProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IDirectLineSpeechChannelProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new DirectLineSpeechChannelProperties(json) : null; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/EmailChannel.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/EmailChannel.PowerShell.cs similarity index 58% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/EmailChannel.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/EmailChannel.PowerShell.cs index d3dd148909c6..ebd601a3d5c4 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/EmailChannel.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/EmailChannel.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,33 +55,41 @@ public partial class EmailChannel 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.BotService.Models.Api20220615Preview.IEmailChannel DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannel DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new EmailChannel(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.BotService.Models.Api20220615Preview.IEmailChannel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new EmailChannel(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -96,49 +104,49 @@ internal EmailChannel(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.EmailChannelPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.EmailChannelPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Etag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Etag, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Etag, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).ProvisioningState, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("EmailAddress")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelInternal)this).EmailAddress = (string) content.GetValueForProperty("EmailAddress",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelInternal)this).EmailAddress, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelInternal)this).EmailAddress = (string) content.GetValueForProperty("EmailAddress",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelInternal)this).EmailAddress, global::System.Convert.ToString); } if (content.Contains("AuthMethod")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelInternal)this).AuthMethod = (float?) content.GetValueForProperty("AuthMethod",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelInternal)this).AuthMethod, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelInternal)this).AuthMethod = (float?) content.GetValueForProperty("AuthMethod",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelInternal)this).AuthMethod, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); } if (content.Contains("Password")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelInternal)this).Password = (string) content.GetValueForProperty("Password",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelInternal)this).Password, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelInternal)this).Password = (string) content.GetValueForProperty("Password",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelInternal)this).Password, global::System.Convert.ToString); } if (content.Contains("MagicCode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelInternal)this).MagicCode = (string) content.GetValueForProperty("MagicCode",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelInternal)this).MagicCode, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelInternal)this).MagicCode = (string) content.GetValueForProperty("MagicCode",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelInternal)this).MagicCode, global::System.Convert.ToString); } if (content.Contains("IsEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelInternal)this).IsEnabled = (bool?) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelInternal)this).IsEnabled, (__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. @@ -153,43 +161,43 @@ internal EmailChannel(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.EmailChannelPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.EmailChannelPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Etag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Etag, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Etag, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).ProvisioningState, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("EmailAddress")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelInternal)this).EmailAddress = (string) content.GetValueForProperty("EmailAddress",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelInternal)this).EmailAddress, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelInternal)this).EmailAddress = (string) content.GetValueForProperty("EmailAddress",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelInternal)this).EmailAddress, global::System.Convert.ToString); } if (content.Contains("AuthMethod")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelInternal)this).AuthMethod = (float?) content.GetValueForProperty("AuthMethod",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelInternal)this).AuthMethod, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelInternal)this).AuthMethod = (float?) content.GetValueForProperty("AuthMethod",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelInternal)this).AuthMethod, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); } if (content.Contains("Password")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelInternal)this).Password = (string) content.GetValueForProperty("Password",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelInternal)this).Password, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelInternal)this).Password = (string) content.GetValueForProperty("Password",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelInternal)this).Password, global::System.Convert.ToString); } if (content.Contains("MagicCode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelInternal)this).MagicCode = (string) content.GetValueForProperty("MagicCode",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelInternal)this).MagicCode, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelInternal)this).MagicCode = (string) content.GetValueForProperty("MagicCode",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelInternal)this).MagicCode, global::System.Convert.ToString); } if (content.Contains("IsEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelInternal)this).IsEnabled = (bool?) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializePSObject(content); } @@ -199,12 +207,24 @@ internal EmailChannel(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.BotService.Models.Api20220615Preview.IEmailChannel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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(); + } } /// Email channel definition [System.ComponentModel.TypeConverter(typeof(EmailChannelTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/EmailChannel.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/EmailChannel.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/EmailChannel.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/EmailChannel.TypeConverter.cs index 9b988698cbaf..3ee497b51d28 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/EmailChannel.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/EmailChannel.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IEmailChannel ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannel ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannel).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannel).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/EmailChannel.cs b/generated/BotService/BotService.Autorest/generated/api/Models/EmailChannel.cs similarity index 66% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/EmailChannel.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/EmailChannel.cs index e5c18cc0155a..fa40f98c5b20 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/EmailChannel.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/EmailChannel.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// Email channel definition public partial class EmailChannel : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannel, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelInternal, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannel, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelInternal, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannel __channel = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Channel(); + private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannel __channel = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Channel(); /// Email channel auth method. 0 Password (Default); 1 Graph. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public float? AuthMethod { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelPropertiesInternal)Property).AuthMethod; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelPropertiesInternal)Property).AuthMethod = value ?? default(float); } + public float? AuthMethod { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelPropertiesInternal)Property).AuthMethod; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelPropertiesInternal)Property).AuthMethod = value ?? default(float); } /// The email address [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string EmailAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelPropertiesInternal)Property).EmailAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelPropertiesInternal)Property).EmailAddress = value ?? null; } + public string EmailAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelPropertiesInternal)Property).EmailAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelPropertiesInternal)Property).EmailAddress = value ?? null; } /// Entity Tag of the resource [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Etag = value ?? null; } + public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Etag = value ?? null; } /// Whether this channel is enabled for the bot [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public bool? IsEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelPropertiesInternal)Property).IsEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelPropertiesInternal)Property).IsEnabled = value ?? default(bool); } + public bool? IsEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelPropertiesInternal)Property).IsEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelPropertiesInternal)Property).IsEnabled = value ?? default(bool); } /// Specifies the location of the resource. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Location = value ?? null; } + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Location = value ?? null; } /// The magic code for setting up the modern authentication. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string MagicCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelPropertiesInternal)Property).MagicCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelPropertiesInternal)Property).MagicCode = value ?? null; } + public string MagicCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelPropertiesInternal)Property).MagicCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelPropertiesInternal)Property).MagicCode = value ?? null; } /// Internal Acessors for ProvisioningState - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).ProvisioningState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).ProvisioningState = value; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelProperties Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.EmailChannelProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelProperties Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.EmailChannelProperties()); set { {_property = value;} } } /// The channel name + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Constant] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Name = value ; } + public string Name { get => "EmailChannel"; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Name = "EmailChannel"; } /// /// The password for the email address. Value only returned through POST to the action Channel List API, otherwise empty. /// [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string Password { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelPropertiesInternal)Property).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelPropertiesInternal)Property).Password = value ?? null; } + public string Password { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelPropertiesInternal)Property).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelPropertiesInternal)Property).Password = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelProperties _property; /// The set of properties specific to email channel resource [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.EmailChannelProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.EmailChannelProperties()); set => this._property = value; } /// Provisioning state of the resource [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).ProvisioningState; } + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).ProvisioningState; } /// Creates an new instance. public EmailChannel() { - + this.__channel.Name = "EmailChannel"; } /// Validates that this object meets the validation criteria. @@ -91,12 +91,15 @@ public EmailChannel() /// Email channel definition public partial interface IEmailChannel : Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannel + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannel { /// Email channel auth method. 0 Password (Default); 1 Graph. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Email channel auth method. 0 Password (Default); 1 Graph.", SerializedName = @"authMethod", PossibleTypes = new [] { typeof(float) })] @@ -105,6 +108,9 @@ public partial interface IEmailChannel : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The email address", SerializedName = @"emailAddress", PossibleTypes = new [] { typeof(string) })] @@ -113,6 +119,9 @@ public partial interface IEmailChannel : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Whether this channel is enabled for the bot", SerializedName = @"isEnabled", PossibleTypes = new [] { typeof(bool) })] @@ -121,6 +130,9 @@ public partial interface IEmailChannel : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The magic code for setting up the modern authentication.", SerializedName = @"magicCode", PossibleTypes = new [] { typeof(string) })] @@ -131,6 +143,9 @@ public partial interface IEmailChannel : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The password for the email address. Value only returned through POST to the action Channel List API, otherwise empty.", SerializedName = @"password", PossibleTypes = new [] { typeof(string) })] @@ -139,7 +154,7 @@ public partial interface IEmailChannel : } /// Email channel definition internal partial interface IEmailChannelInternal : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal { /// Email channel auth method. 0 Password (Default); 1 Graph. float? AuthMethod { get; set; } @@ -154,7 +169,7 @@ internal partial interface IEmailChannelInternal : /// string Password { get; set; } /// The set of properties specific to email channel resource - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelProperties Property { get; set; } } } \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/EmailChannel.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/EmailChannel.json.cs similarity index 93% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/EmailChannel.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/EmailChannel.json.cs index d525afca6f11..7ac7268a9cbd 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/EmailChannel.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/EmailChannel.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -65,19 +65,19 @@ internal EmailChannel(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json { return; } - __channel = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Channel(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.EmailChannelProperties.FromJson(__jsonProperties) : Property;} + __channel = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Channel(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.EmailChannelProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannel. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannel. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannel. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannel. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannel FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannel FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new EmailChannel(json) : null; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/EmailChannelProperties.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/EmailChannelProperties.PowerShell.cs similarity index 65% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/EmailChannelProperties.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/EmailChannelProperties.PowerShell.cs index ac561f3f979d..ad59624e6f51 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/EmailChannelProperties.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/EmailChannelProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,35 +55,41 @@ public partial class EmailChannelProperties 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.BotService.Models.Api20220615Preview.IEmailChannelProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new EmailChannelProperties(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.BotService.Models.Api20220615Preview.IEmailChannelProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new EmailChannelProperties(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -98,29 +104,29 @@ internal EmailChannelProperties(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("EmailAddress")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelPropertiesInternal)this).EmailAddress = (string) content.GetValueForProperty("EmailAddress",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelPropertiesInternal)this).EmailAddress, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelPropertiesInternal)this).EmailAddress = (string) content.GetValueForProperty("EmailAddress",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelPropertiesInternal)this).EmailAddress, global::System.Convert.ToString); } if (content.Contains("AuthMethod")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelPropertiesInternal)this).AuthMethod = (float?) content.GetValueForProperty("AuthMethod",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelPropertiesInternal)this).AuthMethod, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelPropertiesInternal)this).AuthMethod = (float?) content.GetValueForProperty("AuthMethod",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelPropertiesInternal)this).AuthMethod, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); } if (content.Contains("Password")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelPropertiesInternal)this).Password = (string) content.GetValueForProperty("Password",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelPropertiesInternal)this).Password, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelPropertiesInternal)this).Password = (string) content.GetValueForProperty("Password",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelPropertiesInternal)this).Password, global::System.Convert.ToString); } if (content.Contains("MagicCode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelPropertiesInternal)this).MagicCode = (string) content.GetValueForProperty("MagicCode",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelPropertiesInternal)this).MagicCode, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelPropertiesInternal)this).MagicCode = (string) content.GetValueForProperty("MagicCode",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelPropertiesInternal)this).MagicCode, global::System.Convert.ToString); } if (content.Contains("IsEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelPropertiesInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelPropertiesInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelPropertiesInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelPropertiesInternal)this).IsEnabled, (__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. @@ -135,23 +141,23 @@ internal EmailChannelProperties(global::System.Management.Automation.PSObject co // actually deserialize if (content.Contains("EmailAddress")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelPropertiesInternal)this).EmailAddress = (string) content.GetValueForProperty("EmailAddress",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelPropertiesInternal)this).EmailAddress, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelPropertiesInternal)this).EmailAddress = (string) content.GetValueForProperty("EmailAddress",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelPropertiesInternal)this).EmailAddress, global::System.Convert.ToString); } if (content.Contains("AuthMethod")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelPropertiesInternal)this).AuthMethod = (float?) content.GetValueForProperty("AuthMethod",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelPropertiesInternal)this).AuthMethod, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelPropertiesInternal)this).AuthMethod = (float?) content.GetValueForProperty("AuthMethod",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelPropertiesInternal)this).AuthMethod, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); } if (content.Contains("Password")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelPropertiesInternal)this).Password = (string) content.GetValueForProperty("Password",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelPropertiesInternal)this).Password, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelPropertiesInternal)this).Password = (string) content.GetValueForProperty("Password",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelPropertiesInternal)this).Password, global::System.Convert.ToString); } if (content.Contains("MagicCode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelPropertiesInternal)this).MagicCode = (string) content.GetValueForProperty("MagicCode",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelPropertiesInternal)this).MagicCode, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelPropertiesInternal)this).MagicCode = (string) content.GetValueForProperty("MagicCode",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelPropertiesInternal)this).MagicCode, global::System.Convert.ToString); } if (content.Contains("IsEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelPropertiesInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelPropertiesInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelPropertiesInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelPropertiesInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializePSObject(content); } @@ -161,12 +167,24 @@ internal EmailChannelProperties(global::System.Management.Automation.PSObject co /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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 parameters to provide for the Email channel. [System.ComponentModel.TypeConverter(typeof(EmailChannelPropertiesTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/EmailChannelProperties.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/EmailChannelProperties.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/EmailChannelProperties.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/EmailChannelProperties.TypeConverter.cs index d5c366227296..92b0348887bc 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/EmailChannelProperties.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/EmailChannelProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IEmailChannelProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/EmailChannelProperties.cs b/generated/BotService/BotService.Autorest/generated/api/Models/EmailChannelProperties.cs similarity index 91% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/EmailChannelProperties.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/EmailChannelProperties.cs index 979c098c8822..5bef5a9e8551 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/EmailChannelProperties.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/EmailChannelProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// The parameters to provide for the Email channel. public partial class EmailChannelProperties : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelProperties, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelProperties, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelPropertiesInternal { /// Backing field for property. @@ -64,6 +64,9 @@ public partial interface IEmailChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Email channel auth method. 0 Password (Default); 1 Graph.", SerializedName = @"authMethod", PossibleTypes = new [] { typeof(float) })] @@ -72,6 +75,9 @@ public partial interface IEmailChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The email address", SerializedName = @"emailAddress", PossibleTypes = new [] { typeof(string) })] @@ -80,6 +86,9 @@ public partial interface IEmailChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Whether this channel is enabled for the bot", SerializedName = @"isEnabled", PossibleTypes = new [] { typeof(bool) })] @@ -88,6 +97,9 @@ public partial interface IEmailChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The magic code for setting up the modern authentication.", SerializedName = @"magicCode", PossibleTypes = new [] { typeof(string) })] @@ -98,6 +110,9 @@ public partial interface IEmailChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The password for the email address. Value only returned through POST to the action Channel List API, otherwise empty.", SerializedName = @"password", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/EmailChannelProperties.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/EmailChannelProperties.json.cs similarity index 92% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/EmailChannelProperties.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/EmailChannelProperties.json.cs index d3d89758fe78..8e55429391f8 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/EmailChannelProperties.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/EmailChannelProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -65,22 +65,22 @@ internal EmailChannelProperties(Microsoft.Azure.PowerShell.Cmdlets.BotService.Ru { return; } - {_emailAddress = If( json?.PropertyT("emailAddress"), out var __jsonEmailAddress) ? (string)__jsonEmailAddress : (string)EmailAddress;} - {_authMethod = If( json?.PropertyT("authMethod"), out var __jsonAuthMethod) ? (float?)__jsonAuthMethod : AuthMethod;} - {_password = If( json?.PropertyT("password"), out var __jsonPassword) ? (string)__jsonPassword : (string)Password;} - {_magicCode = If( json?.PropertyT("magicCode"), out var __jsonMagicCode) ? (string)__jsonMagicCode : (string)MagicCode;} - {_isEnabled = If( json?.PropertyT("isEnabled"), out var __jsonIsEnabled) ? (bool)__jsonIsEnabled : IsEnabled;} + {_emailAddress = If( json?.PropertyT("emailAddress"), out var __jsonEmailAddress) ? (string)__jsonEmailAddress : (string)_emailAddress;} + {_authMethod = If( json?.PropertyT("authMethod"), out var __jsonAuthMethod) ? (float?)__jsonAuthMethod : _authMethod;} + {_password = If( json?.PropertyT("password"), out var __jsonPassword) ? (string)__jsonPassword : (string)_password;} + {_magicCode = If( json?.PropertyT("magicCode"), out var __jsonMagicCode) ? (string)__jsonMagicCode : (string)_magicCode;} + {_isEnabled = If( json?.PropertyT("isEnabled"), out var __jsonIsEnabled) ? (bool)__jsonIsEnabled : _isEnabled;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IEmailChannelProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IEmailChannelProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new EmailChannelProperties(json) : null; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Error.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/Error.PowerShell.cs similarity index 71% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Error.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/Error.PowerShell.cs index ee5a237ba665..acf71c182707 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Error.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/Error.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,33 +55,41 @@ public partial class Error 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.BotService.Models.Api20220615Preview.IError DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IError DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new Error(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.BotService.Models.Api20220615Preview.IError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new Error(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -96,21 +104,21 @@ internal Error(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Error1")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IErrorInternal)this).Error1 = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IErrorBody) content.GetValueForProperty("Error1",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IErrorInternal)this).Error1, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ErrorBodyTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IErrorInternal)this).Error1 = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IErrorBody) content.GetValueForProperty("Error1",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IErrorInternal)this).Error1, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ErrorBodyTypeConverter.ConvertFrom); } if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IErrorInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IErrorInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IErrorInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IErrorInternal)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. @@ -125,15 +133,15 @@ internal Error(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Error1")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IErrorInternal)this).Error1 = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IErrorBody) content.GetValueForProperty("Error1",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IErrorInternal)this).Error1, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ErrorBodyTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IErrorInternal)this).Error1 = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IErrorBody) content.GetValueForProperty("Error1",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IErrorInternal)this).Error1, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ErrorBodyTypeConverter.ConvertFrom); } if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IErrorInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IErrorInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IErrorInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IErrorInternal)this).Message, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -143,12 +151,24 @@ internal Error(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.BotService.Models.Api20220615Preview.IError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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(); + } } /// Bot Service error object. [System.ComponentModel.TypeConverter(typeof(ErrorTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Error.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/Error.TypeConverter.cs similarity index 97% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Error.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/Error.TypeConverter.cs index cb6d6dea63f7..77169dfffc59 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Error.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/Error.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IError ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IError ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IError).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IError).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Error.cs b/generated/BotService/BotService.Autorest/generated/api/Models/Error.cs similarity index 65% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Error.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/Error.cs index c732712a076a..bb6e5ff8d400 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Error.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/Error.cs @@ -3,33 +3,33 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// Bot Service error object. public partial class Error : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IError, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IErrorInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IError, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IErrorInternal { /// error code [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IErrorBodyInternal)Error1).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IErrorBodyInternal)Error1).Code = value ?? null; } + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IErrorBodyInternal)Error1).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IErrorBodyInternal)Error1).Code = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IErrorBody _error1; + private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IErrorBody _error1; /// The error body. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IErrorBody Error1 { get => (this._error1 = this._error1 ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ErrorBody()); set => this._error1 = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IErrorBody Error1 { get => (this._error1 = this._error1 ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ErrorBody()); set => this._error1 = value; } /// error message [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IErrorBodyInternal)Error1).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IErrorBodyInternal)Error1).Message = value ?? null; } + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IErrorBodyInternal)Error1).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IErrorBodyInternal)Error1).Message = value ?? null; } /// Internal Acessors for Error1 - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IErrorBody Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IErrorInternal.Error1 { get => (this._error1 = this._error1 ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ErrorBody()); set { {_error1 = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IErrorBody Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IErrorInternal.Error1 { get => (this._error1 = this._error1 ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ErrorBody()); set { {_error1 = value;} } } /// Creates an new instance. public Error() @@ -45,6 +45,9 @@ public partial interface IError : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"error code", SerializedName = @"code", PossibleTypes = new [] { typeof(string) })] @@ -53,6 +56,9 @@ public partial interface IError : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"error message", SerializedName = @"message", PossibleTypes = new [] { typeof(string) })] @@ -66,7 +72,7 @@ internal partial interface IErrorInternal /// error code string Code { get; set; } /// The error body. - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IErrorBody Error1 { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IErrorBody Error1 { get; set; } /// error message string Message { get; set; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Error.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/Error.json.cs similarity index 92% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Error.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/Error.json.cs index 07cfb042b598..05dda0e15bd4 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Error.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/Error.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -65,18 +65,16 @@ internal Error(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonOb { return; } - {_error1 = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ErrorBody.FromJson(__jsonError) : Error1;} + {_error1 = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ErrorBody.FromJson(__jsonError) : _error1;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IError. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IError. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IError. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IError FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IError. + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IError FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new Error(json) : null; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ErrorBody.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/ErrorBody.PowerShell.cs similarity index 75% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ErrorBody.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/ErrorBody.PowerShell.cs index baca3a30d862..ae590d0a6b01 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ErrorBody.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/ErrorBody.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,33 +55,41 @@ public partial class ErrorBody 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.BotService.Models.Api20220615Preview.IErrorBody DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IErrorBody DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ErrorBody(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.BotService.Models.Api20220615Preview.IErrorBody DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IErrorBody DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ErrorBody(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -96,17 +104,17 @@ internal ErrorBody(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IErrorBodyInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IErrorBodyInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IErrorBodyInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IErrorBodyInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IErrorBodyInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IErrorBodyInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IErrorBodyInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IErrorBodyInternal)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. @@ -121,11 +129,11 @@ internal ErrorBody(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IErrorBodyInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IErrorBodyInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IErrorBodyInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IErrorBodyInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IErrorBodyInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IErrorBodyInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IErrorBodyInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IErrorBodyInternal)this).Message, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -135,12 +143,24 @@ internal ErrorBody(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.BotService.Models.Api20220615Preview.IErrorBody FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IErrorBody FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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(); + } } /// Bot Service error body. [System.ComponentModel.TypeConverter(typeof(ErrorBodyTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ErrorBody.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/ErrorBody.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ErrorBody.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/ErrorBody.TypeConverter.cs index 459a7c62f079..67474e156d0c 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ErrorBody.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/ErrorBody.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IErrorBody ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IErrorBody ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IErrorBody).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IErrorBody).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ErrorBody.cs b/generated/BotService/BotService.Autorest/generated/api/Models/ErrorBody.cs similarity index 87% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ErrorBody.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/ErrorBody.cs index 728174294610..79241298c25d 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ErrorBody.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/ErrorBody.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// Bot Service error body. public partial class ErrorBody : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IErrorBody, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IErrorBodyInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IErrorBody, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IErrorBodyInternal { /// Backing field for property. @@ -41,6 +41,9 @@ public partial interface IErrorBody : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"error code", SerializedName = @"code", PossibleTypes = new [] { typeof(string) })] @@ -49,6 +52,9 @@ public partial interface IErrorBody : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"error message", SerializedName = @"message", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ErrorBody.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/ErrorBody.json.cs similarity index 92% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ErrorBody.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/ErrorBody.json.cs index 9e3feda17989..abf7865d64af 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ErrorBody.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/ErrorBody.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -65,19 +65,17 @@ internal ErrorBody(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.Js { 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.BotService.Models.Api20220615Preview.IErrorBody. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IErrorBody. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IErrorBody. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IErrorBody FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IErrorBody. + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IErrorBody FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new ErrorBody(json) : null; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/FacebookChannel.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/FacebookChannel.PowerShell.cs similarity index 55% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/FacebookChannel.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/FacebookChannel.PowerShell.cs index b49d32bf3acd..0079b50deec0 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/FacebookChannel.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/FacebookChannel.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,33 +55,41 @@ public partial class FacebookChannel 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.BotService.Models.Api20220615Preview.IFacebookChannel DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannel DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new FacebookChannel(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.BotService.Models.Api20220615Preview.IFacebookChannel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new FacebookChannel(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -96,53 +104,53 @@ internal FacebookChannel(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.FacebookChannelPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.FacebookChannelPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Etag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Etag, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Etag, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).ProvisioningState, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("VerifyToken")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelInternal)this).VerifyToken = (string) content.GetValueForProperty("VerifyToken",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelInternal)this).VerifyToken, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelInternal)this).VerifyToken = (string) content.GetValueForProperty("VerifyToken",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelInternal)this).VerifyToken, global::System.Convert.ToString); } if (content.Contains("Page")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelInternal)this).Page = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookPage[]) content.GetValueForProperty("Page",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelInternal)this).Page, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.FacebookPageTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelInternal)this).Page = (System.Collections.Generic.List) content.GetValueForProperty("Page",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelInternal)this).Page, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.FacebookPageTypeConverter.ConvertFrom)); } if (content.Contains("AppId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelInternal)this).AppId = (string) content.GetValueForProperty("AppId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelInternal)this).AppId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelInternal)this).AppId = (string) content.GetValueForProperty("AppId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelInternal)this).AppId, global::System.Convert.ToString); } if (content.Contains("AppSecret")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelInternal)this).AppSecret = (string) content.GetValueForProperty("AppSecret",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelInternal)this).AppSecret, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelInternal)this).AppSecret = (string) content.GetValueForProperty("AppSecret",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelInternal)this).AppSecret, global::System.Convert.ToString); } if (content.Contains("CallbackUrl")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelInternal)this).CallbackUrl = (string) content.GetValueForProperty("CallbackUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelInternal)this).CallbackUrl, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelInternal)this).CallbackUrl = (string) content.GetValueForProperty("CallbackUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelInternal)this).CallbackUrl, global::System.Convert.ToString); } if (content.Contains("IsEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelInternal)this).IsEnabled = (bool?) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelInternal)this).IsEnabled, (__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. @@ -157,47 +165,47 @@ internal FacebookChannel(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.FacebookChannelPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.FacebookChannelPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Etag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Etag, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Etag, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).ProvisioningState, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("VerifyToken")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelInternal)this).VerifyToken = (string) content.GetValueForProperty("VerifyToken",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelInternal)this).VerifyToken, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelInternal)this).VerifyToken = (string) content.GetValueForProperty("VerifyToken",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelInternal)this).VerifyToken, global::System.Convert.ToString); } if (content.Contains("Page")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelInternal)this).Page = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookPage[]) content.GetValueForProperty("Page",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelInternal)this).Page, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.FacebookPageTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelInternal)this).Page = (System.Collections.Generic.List) content.GetValueForProperty("Page",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelInternal)this).Page, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.FacebookPageTypeConverter.ConvertFrom)); } if (content.Contains("AppId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelInternal)this).AppId = (string) content.GetValueForProperty("AppId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelInternal)this).AppId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelInternal)this).AppId = (string) content.GetValueForProperty("AppId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelInternal)this).AppId, global::System.Convert.ToString); } if (content.Contains("AppSecret")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelInternal)this).AppSecret = (string) content.GetValueForProperty("AppSecret",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelInternal)this).AppSecret, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelInternal)this).AppSecret = (string) content.GetValueForProperty("AppSecret",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelInternal)this).AppSecret, global::System.Convert.ToString); } if (content.Contains("CallbackUrl")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelInternal)this).CallbackUrl = (string) content.GetValueForProperty("CallbackUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelInternal)this).CallbackUrl, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelInternal)this).CallbackUrl = (string) content.GetValueForProperty("CallbackUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelInternal)this).CallbackUrl, global::System.Convert.ToString); } if (content.Contains("IsEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelInternal)this).IsEnabled = (bool?) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializePSObject(content); } @@ -207,12 +215,24 @@ internal FacebookChannel(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.BotService.Models.Api20220615Preview.IFacebookChannel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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(); + } } /// Facebook channel definition [System.ComponentModel.TypeConverter(typeof(FacebookChannelTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/FacebookChannel.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/FacebookChannel.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/FacebookChannel.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/FacebookChannel.TypeConverter.cs index 6764ce267427..b0d366f70c91 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/FacebookChannel.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/FacebookChannel.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IFacebookChannel ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannel ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannel).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannel).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/FacebookChannel.cs b/generated/BotService/BotService.Autorest/generated/api/Models/FacebookChannel.cs similarity index 63% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/FacebookChannel.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/FacebookChannel.cs index c698b005de05..6506b58bcde2 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/FacebookChannel.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/FacebookChannel.cs @@ -3,89 +3,89 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// Facebook channel definition public partial class FacebookChannel : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannel, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelInternal, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannel, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelInternal, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannel __channel = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Channel(); + private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannel __channel = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Channel(); /// Facebook application id [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string AppId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelPropertiesInternal)Property).AppId; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelPropertiesInternal)Property).AppId = value ?? null; } + public string AppId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelPropertiesInternal)Property).AppId; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelPropertiesInternal)Property).AppId = value ?? null; } /// /// Facebook application secret. Value only returned through POST to the action Channel List API, otherwise empty. /// [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string AppSecret { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelPropertiesInternal)Property).AppSecret; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelPropertiesInternal)Property).AppSecret = value ?? null; } + public string AppSecret { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelPropertiesInternal)Property).AppSecret; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelPropertiesInternal)Property).AppSecret = value ?? null; } /// Callback Url [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string CallbackUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelPropertiesInternal)Property).CallbackUrl; } + public string CallbackUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelPropertiesInternal)Property).CallbackUrl; } /// Entity Tag of the resource [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Etag = value ?? null; } + public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Etag = value ?? null; } /// Whether this channel is enabled for the bot [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public bool? IsEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelPropertiesInternal)Property).IsEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelPropertiesInternal)Property).IsEnabled = value ?? default(bool); } + public bool? IsEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelPropertiesInternal)Property).IsEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelPropertiesInternal)Property).IsEnabled = value ?? default(bool); } /// Specifies the location of the resource. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Location = value ?? null; } + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Location = value ?? null; } /// Internal Acessors for ProvisioningState - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).ProvisioningState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).ProvisioningState = value; } /// Internal Acessors for CallbackUrl - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelInternal.CallbackUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelPropertiesInternal)Property).CallbackUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelPropertiesInternal)Property).CallbackUrl = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelInternal.CallbackUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelPropertiesInternal)Property).CallbackUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelPropertiesInternal)Property).CallbackUrl = value; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelProperties Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.FacebookChannelProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelProperties Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.FacebookChannelProperties()); set { {_property = value;} } } /// Internal Acessors for VerifyToken - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelInternal.VerifyToken { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelPropertiesInternal)Property).VerifyToken; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelPropertiesInternal)Property).VerifyToken = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelInternal.VerifyToken { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelPropertiesInternal)Property).VerifyToken; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelPropertiesInternal)Property).VerifyToken = value; } /// The channel name + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Constant] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Name = value ; } + public string Name { get => "FacebookChannel"; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Name = "FacebookChannel"; } /// The list of Facebook pages [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookPage[] Page { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelPropertiesInternal)Property).Page; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelPropertiesInternal)Property).Page = value ?? null /* arrayOf */; } + public System.Collections.Generic.List Page { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelPropertiesInternal)Property).Page; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelPropertiesInternal)Property).Page = value ?? null /* arrayOf */; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelProperties _property; /// The set of properties specific to bot facebook channel [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.FacebookChannelProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.FacebookChannelProperties()); set => this._property = value; } /// Provisioning state of the resource [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).ProvisioningState; } + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).ProvisioningState; } /// /// Verify token. Value only returned through POST to the action Channel List API, otherwise empty. /// [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string VerifyToken { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelPropertiesInternal)Property).VerifyToken; } + public string VerifyToken { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelPropertiesInternal)Property).VerifyToken; } /// Creates an new instance. public FacebookChannel() { - + this.__channel.Name = "FacebookChannel"; } /// Validates that this object meets the validation criteria. @@ -103,12 +103,15 @@ public FacebookChannel() /// Facebook channel definition public partial interface IFacebookChannel : Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannel + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannel { /// Facebook application id [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Facebook application id", SerializedName = @"appId", PossibleTypes = new [] { typeof(string) })] @@ -119,6 +122,9 @@ public partial interface IFacebookChannel : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Facebook application secret. Value only returned through POST to the action Channel List API, otherwise empty.", SerializedName = @"appSecret", PossibleTypes = new [] { typeof(string) })] @@ -127,6 +133,9 @@ public partial interface IFacebookChannel : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Callback Url", SerializedName = @"callbackUrl", PossibleTypes = new [] { typeof(string) })] @@ -135,6 +144,9 @@ public partial interface IFacebookChannel : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Whether this channel is enabled for the bot", SerializedName = @"isEnabled", PossibleTypes = new [] { typeof(bool) })] @@ -143,16 +155,22 @@ public partial interface IFacebookChannel : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of Facebook pages", SerializedName = @"pages", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookPage) })] - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookPage[] Page { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookPage) })] + System.Collections.Generic.List Page { get; set; } /// /// Verify token. Value only returned through POST to the action Channel List API, otherwise empty. /// [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Verify token. Value only returned through POST to the action Channel List API, otherwise empty.", SerializedName = @"verifyToken", PossibleTypes = new [] { typeof(string) })] @@ -161,7 +179,7 @@ public partial interface IFacebookChannel : } /// Facebook channel definition internal partial interface IFacebookChannelInternal : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal { /// Facebook application id string AppId { get; set; } @@ -174,9 +192,9 @@ internal partial interface IFacebookChannelInternal : /// Whether this channel is enabled for the bot bool? IsEnabled { get; set; } /// The list of Facebook pages - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookPage[] Page { get; set; } + System.Collections.Generic.List Page { get; set; } /// The set of properties specific to bot facebook channel - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelProperties Property { get; set; } /// /// Verify token. Value only returned through POST to the action Channel List API, otherwise empty. /// diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/FacebookChannel.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/FacebookChannel.json.cs similarity index 92% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/FacebookChannel.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/FacebookChannel.json.cs index cb2d79029399..cebb13dab1e8 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/FacebookChannel.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/FacebookChannel.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -65,19 +65,19 @@ internal FacebookChannel(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.J { return; } - __channel = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Channel(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.FacebookChannelProperties.FromJson(__jsonProperties) : Property;} + __channel = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Channel(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.FacebookChannelProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannel. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannel. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannel. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannel. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannel FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannel FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new FacebookChannel(json) : null; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/FacebookChannelProperties.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/FacebookChannelProperties.PowerShell.cs similarity index 61% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/FacebookChannelProperties.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/FacebookChannelProperties.PowerShell.cs index 994397c69667..d52bcf5fcfd3 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/FacebookChannelProperties.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/FacebookChannelProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,35 +55,41 @@ public partial class FacebookChannelProperties 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.BotService.Models.Api20220615Preview.IFacebookChannelProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new FacebookChannelProperties(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.BotService.Models.Api20220615Preview.IFacebookChannelProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new FacebookChannelProperties(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -98,33 +104,33 @@ internal FacebookChannelProperties(global::System.Collections.IDictionary conten // actually deserialize if (content.Contains("VerifyToken")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelPropertiesInternal)this).VerifyToken = (string) content.GetValueForProperty("VerifyToken",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelPropertiesInternal)this).VerifyToken, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelPropertiesInternal)this).VerifyToken = (string) content.GetValueForProperty("VerifyToken",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelPropertiesInternal)this).VerifyToken, global::System.Convert.ToString); } if (content.Contains("Page")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelPropertiesInternal)this).Page = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookPage[]) content.GetValueForProperty("Page",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelPropertiesInternal)this).Page, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.FacebookPageTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelPropertiesInternal)this).Page = (System.Collections.Generic.List) content.GetValueForProperty("Page",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelPropertiesInternal)this).Page, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.FacebookPageTypeConverter.ConvertFrom)); } if (content.Contains("AppId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelPropertiesInternal)this).AppId = (string) content.GetValueForProperty("AppId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelPropertiesInternal)this).AppId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelPropertiesInternal)this).AppId = (string) content.GetValueForProperty("AppId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelPropertiesInternal)this).AppId, global::System.Convert.ToString); } if (content.Contains("AppSecret")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelPropertiesInternal)this).AppSecret = (string) content.GetValueForProperty("AppSecret",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelPropertiesInternal)this).AppSecret, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelPropertiesInternal)this).AppSecret = (string) content.GetValueForProperty("AppSecret",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelPropertiesInternal)this).AppSecret, global::System.Convert.ToString); } if (content.Contains("CallbackUrl")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelPropertiesInternal)this).CallbackUrl = (string) content.GetValueForProperty("CallbackUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelPropertiesInternal)this).CallbackUrl, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelPropertiesInternal)this).CallbackUrl = (string) content.GetValueForProperty("CallbackUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelPropertiesInternal)this).CallbackUrl, global::System.Convert.ToString); } if (content.Contains("IsEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelPropertiesInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelPropertiesInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelPropertiesInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelPropertiesInternal)this).IsEnabled, (__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. @@ -139,27 +145,27 @@ internal FacebookChannelProperties(global::System.Management.Automation.PSObject // actually deserialize if (content.Contains("VerifyToken")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelPropertiesInternal)this).VerifyToken = (string) content.GetValueForProperty("VerifyToken",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelPropertiesInternal)this).VerifyToken, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelPropertiesInternal)this).VerifyToken = (string) content.GetValueForProperty("VerifyToken",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelPropertiesInternal)this).VerifyToken, global::System.Convert.ToString); } if (content.Contains("Page")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelPropertiesInternal)this).Page = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookPage[]) content.GetValueForProperty("Page",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelPropertiesInternal)this).Page, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.FacebookPageTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelPropertiesInternal)this).Page = (System.Collections.Generic.List) content.GetValueForProperty("Page",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelPropertiesInternal)this).Page, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.FacebookPageTypeConverter.ConvertFrom)); } if (content.Contains("AppId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelPropertiesInternal)this).AppId = (string) content.GetValueForProperty("AppId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelPropertiesInternal)this).AppId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelPropertiesInternal)this).AppId = (string) content.GetValueForProperty("AppId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelPropertiesInternal)this).AppId, global::System.Convert.ToString); } if (content.Contains("AppSecret")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelPropertiesInternal)this).AppSecret = (string) content.GetValueForProperty("AppSecret",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelPropertiesInternal)this).AppSecret, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelPropertiesInternal)this).AppSecret = (string) content.GetValueForProperty("AppSecret",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelPropertiesInternal)this).AppSecret, global::System.Convert.ToString); } if (content.Contains("CallbackUrl")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelPropertiesInternal)this).CallbackUrl = (string) content.GetValueForProperty("CallbackUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelPropertiesInternal)this).CallbackUrl, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelPropertiesInternal)this).CallbackUrl = (string) content.GetValueForProperty("CallbackUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelPropertiesInternal)this).CallbackUrl, global::System.Convert.ToString); } if (content.Contains("IsEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelPropertiesInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelPropertiesInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelPropertiesInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelPropertiesInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializePSObject(content); } @@ -169,12 +175,24 @@ internal FacebookChannelProperties(global::System.Management.Automation.PSObject /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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 parameters to provide for the Facebook channel. [System.ComponentModel.TypeConverter(typeof(FacebookChannelPropertiesTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/FacebookChannelProperties.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/FacebookChannelProperties.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/FacebookChannelProperties.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/FacebookChannelProperties.TypeConverter.cs index e0ee37ad7084..e97b7c123669 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/FacebookChannelProperties.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/FacebookChannelProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IFacebookChannelProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/FacebookChannelProperties.cs b/generated/BotService/BotService.Autorest/generated/api/Models/FacebookChannelProperties.cs similarity index 82% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/FacebookChannelProperties.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/FacebookChannelProperties.cs index dcf45235dd59..87d94dc3242d 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/FacebookChannelProperties.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/FacebookChannelProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// The parameters to provide for the Facebook channel. public partial class FacebookChannelProperties : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelProperties, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelProperties, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelPropertiesInternal { /// Backing field for property. @@ -44,17 +44,17 @@ public partial class FacebookChannelProperties : public bool IsEnabled { get => this._isEnabled; set => this._isEnabled = value; } /// Internal Acessors for CallbackUrl - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelPropertiesInternal.CallbackUrl { get => this._callbackUrl; set { {_callbackUrl = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelPropertiesInternal.CallbackUrl { get => this._callbackUrl; set { {_callbackUrl = value;} } } /// Internal Acessors for VerifyToken - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelPropertiesInternal.VerifyToken { get => this._verifyToken; set { {_verifyToken = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelPropertiesInternal.VerifyToken { get => this._verifyToken; set { {_verifyToken = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookPage[] _page; + private System.Collections.Generic.List _page; /// The list of Facebook pages [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookPage[] Page { get => this._page; set => this._page = value; } + public System.Collections.Generic.List Page { get => this._page; set => this._page = value; } /// Backing field for property. private string _verifyToken; @@ -79,6 +79,9 @@ public partial interface IFacebookChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Facebook application id", SerializedName = @"appId", PossibleTypes = new [] { typeof(string) })] @@ -89,6 +92,9 @@ public partial interface IFacebookChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Facebook application secret. Value only returned through POST to the action Channel List API, otherwise empty.", SerializedName = @"appSecret", PossibleTypes = new [] { typeof(string) })] @@ -97,6 +103,9 @@ public partial interface IFacebookChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Callback Url", SerializedName = @"callbackUrl", PossibleTypes = new [] { typeof(string) })] @@ -105,6 +114,9 @@ public partial interface IFacebookChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Whether this channel is enabled for the bot", SerializedName = @"isEnabled", PossibleTypes = new [] { typeof(bool) })] @@ -113,16 +125,22 @@ public partial interface IFacebookChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of Facebook pages", SerializedName = @"pages", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookPage) })] - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookPage[] Page { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookPage) })] + System.Collections.Generic.List Page { get; set; } /// /// Verify token. Value only returned through POST to the action Channel List API, otherwise empty. /// [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Verify token. Value only returned through POST to the action Channel List API, otherwise empty.", SerializedName = @"verifyToken", PossibleTypes = new [] { typeof(string) })] @@ -144,7 +162,7 @@ internal partial interface IFacebookChannelPropertiesInternal /// Whether this channel is enabled for the bot bool IsEnabled { get; set; } /// The list of Facebook pages - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookPage[] Page { get; set; } + System.Collections.Generic.List Page { get; set; } /// /// Verify token. Value only returned through POST to the action Channel List API, otherwise empty. /// diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/FacebookChannelProperties.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/FacebookChannelProperties.json.cs similarity index 89% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/FacebookChannelProperties.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/FacebookChannelProperties.json.cs index 4db6c3be83d9..28af150c4e90 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/FacebookChannelProperties.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/FacebookChannelProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -65,23 +65,23 @@ internal FacebookChannelProperties(Microsoft.Azure.PowerShell.Cmdlets.BotService { return; } - {_verifyToken = If( json?.PropertyT("verifyToken"), out var __jsonVerifyToken) ? (string)__jsonVerifyToken : (string)VerifyToken;} - {_page = If( json?.PropertyT("pages"), out var __jsonPages) ? If( __jsonPages as Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IFacebookPage) (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.FacebookPage.FromJson(__u) )) ))() : null : Page;} - {_appId = If( json?.PropertyT("appId"), out var __jsonAppId) ? (string)__jsonAppId : (string)AppId;} - {_appSecret = If( json?.PropertyT("appSecret"), out var __jsonAppSecret) ? (string)__jsonAppSecret : (string)AppSecret;} - {_callbackUrl = If( json?.PropertyT("callbackUrl"), out var __jsonCallbackUrl) ? (string)__jsonCallbackUrl : (string)CallbackUrl;} - {_isEnabled = If( json?.PropertyT("isEnabled"), out var __jsonIsEnabled) ? (bool)__jsonIsEnabled : IsEnabled;} + {_verifyToken = If( json?.PropertyT("verifyToken"), out var __jsonVerifyToken) ? (string)__jsonVerifyToken : (string)_verifyToken;} + {_page = If( json?.PropertyT("pages"), out var __jsonPages) ? If( __jsonPages as Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.IFacebookPage) (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.FacebookPage.FromJson(__u) )) ))() : null : _page;} + {_appId = If( json?.PropertyT("appId"), out var __jsonAppId) ? (string)__jsonAppId : (string)_appId;} + {_appSecret = If( json?.PropertyT("appSecret"), out var __jsonAppSecret) ? (string)__jsonAppSecret : (string)_appSecret;} + {_callbackUrl = If( json?.PropertyT("callbackUrl"), out var __jsonCallbackUrl) ? (string)__jsonCallbackUrl : (string)_callbackUrl;} + {_isEnabled = If( json?.PropertyT("isEnabled"), out var __jsonIsEnabled) ? (bool)__jsonIsEnabled : _isEnabled;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookChannelProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookChannelProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new FacebookChannelProperties(json) : null; } @@ -105,7 +105,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode ToJso { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._verifyToken)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._verifyToken.ToString()) : null, "verifyToken" ,container.Add ); } @@ -120,7 +120,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode ToJso } AddIf( null != (((object)this._appId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._appId.ToString()) : null, "appId" ,container.Add ); AddIf( null != (((object)this._appSecret)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._appSecret.ToString()) : null, "appSecret" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._callbackUrl)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._callbackUrl.ToString()) : null, "callbackUrl" ,container.Add ); } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/FacebookPage.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/FacebookPage.PowerShell.cs similarity index 74% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/FacebookPage.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/FacebookPage.PowerShell.cs index 22db083ad42a..f8d71dcfca40 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/FacebookPage.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/FacebookPage.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,33 +55,41 @@ public partial class FacebookPage 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.BotService.Models.Api20220615Preview.IFacebookPage DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookPage DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new FacebookPage(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.BotService.Models.Api20220615Preview.IFacebookPage DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookPage DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new FacebookPage(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -96,17 +104,17 @@ internal FacebookPage(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookPageInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookPageInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookPageInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookPageInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("AccessToken")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookPageInternal)this).AccessToken = (string) content.GetValueForProperty("AccessToken",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookPageInternal)this).AccessToken, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookPageInternal)this).AccessToken = (string) content.GetValueForProperty("AccessToken",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookPageInternal)this).AccessToken, 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. @@ -121,11 +129,11 @@ internal FacebookPage(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookPageInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookPageInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookPageInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookPageInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("AccessToken")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookPageInternal)this).AccessToken = (string) content.GetValueForProperty("AccessToken",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookPageInternal)this).AccessToken, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookPageInternal)this).AccessToken = (string) content.GetValueForProperty("AccessToken",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookPageInternal)this).AccessToken, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -135,12 +143,24 @@ internal FacebookPage(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.BotService.Models.Api20220615Preview.IFacebookPage FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookPage FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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 Facebook page for Facebook channel registration [System.ComponentModel.TypeConverter(typeof(FacebookPageTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/FacebookPage.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/FacebookPage.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/FacebookPage.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/FacebookPage.TypeConverter.cs index 3f08c48e174f..0dc38ade1670 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/FacebookPage.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/FacebookPage.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IFacebookPage ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookPage ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookPage).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookPage).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/FacebookPage.cs b/generated/BotService/BotService.Autorest/generated/api/Models/FacebookPage.cs similarity index 89% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/FacebookPage.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/FacebookPage.cs index d44b115c355e..c688bd3da3f5 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/FacebookPage.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/FacebookPage.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// A Facebook page for Facebook channel registration public partial class FacebookPage : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookPage, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookPageInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookPage, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookPageInternal { /// Backing field for property. @@ -45,6 +45,9 @@ public partial interface IFacebookPage : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Facebook application access token. Value only returned through POST to the action Channel List API, otherwise empty.", SerializedName = @"accessToken", PossibleTypes = new [] { typeof(string) })] @@ -53,6 +56,9 @@ public partial interface IFacebookPage : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Page id", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/FacebookPage.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/FacebookPage.json.cs similarity index 94% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/FacebookPage.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/FacebookPage.json.cs index 272993cbf34d..cc7de0b0ab87 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/FacebookPage.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/FacebookPage.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -65,19 +65,19 @@ internal FacebookPage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json { return; } - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_accessToken = If( json?.PropertyT("accessToken"), out var __jsonAccessToken) ? (string)__jsonAccessToken : (string)AccessToken;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_accessToken = If( json?.PropertyT("accessToken"), out var __jsonAccessToken) ? (string)__jsonAccessToken : (string)_accessToken;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookPage. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookPage. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookPage. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookPage. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IFacebookPage FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IFacebookPage FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new FacebookPage(json) : null; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/HostSettingsResponse.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/HostSettingsResponse.PowerShell.cs similarity index 60% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/HostSettingsResponse.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/HostSettingsResponse.PowerShell.cs index 6cf2eff7b1e7..c9fbd19be151 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/HostSettingsResponse.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/HostSettingsResponse.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -57,29 +57,35 @@ public partial class HostSettingsResponse 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.BotService.Models.Api20220615Preview.IHostSettingsResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IHostSettingsResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new HostSettingsResponse(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.BotService.Models.Api20220615Preview.IHostSettingsResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IHostSettingsResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new HostSettingsResponse(content); } @@ -89,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Pr /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IHostSettingsResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IHostSettingsResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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,41 +113,41 @@ internal HostSettingsResponse(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("OAuthUrl")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IHostSettingsResponseInternal)this).OAuthUrl = (string) content.GetValueForProperty("OAuthUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IHostSettingsResponseInternal)this).OAuthUrl, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IHostSettingsResponseInternal)this).OAuthUrl = (string) content.GetValueForProperty("OAuthUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IHostSettingsResponseInternal)this).OAuthUrl, global::System.Convert.ToString); } if (content.Contains("ToBotFromChannelOpenIdMetadataUrl")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IHostSettingsResponseInternal)this).ToBotFromChannelOpenIdMetadataUrl = (string) content.GetValueForProperty("ToBotFromChannelOpenIdMetadataUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IHostSettingsResponseInternal)this).ToBotFromChannelOpenIdMetadataUrl, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IHostSettingsResponseInternal)this).ToBotFromChannelOpenIdMetadataUrl = (string) content.GetValueForProperty("ToBotFromChannelOpenIdMetadataUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IHostSettingsResponseInternal)this).ToBotFromChannelOpenIdMetadataUrl, global::System.Convert.ToString); } if (content.Contains("ToBotFromChannelTokenIssuer")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IHostSettingsResponseInternal)this).ToBotFromChannelTokenIssuer = (string) content.GetValueForProperty("ToBotFromChannelTokenIssuer",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IHostSettingsResponseInternal)this).ToBotFromChannelTokenIssuer, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IHostSettingsResponseInternal)this).ToBotFromChannelTokenIssuer = (string) content.GetValueForProperty("ToBotFromChannelTokenIssuer",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IHostSettingsResponseInternal)this).ToBotFromChannelTokenIssuer, global::System.Convert.ToString); } if (content.Contains("ToBotFromEmulatorOpenIdMetadataUrl")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IHostSettingsResponseInternal)this).ToBotFromEmulatorOpenIdMetadataUrl = (string) content.GetValueForProperty("ToBotFromEmulatorOpenIdMetadataUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IHostSettingsResponseInternal)this).ToBotFromEmulatorOpenIdMetadataUrl, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IHostSettingsResponseInternal)this).ToBotFromEmulatorOpenIdMetadataUrl = (string) content.GetValueForProperty("ToBotFromEmulatorOpenIdMetadataUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IHostSettingsResponseInternal)this).ToBotFromEmulatorOpenIdMetadataUrl, global::System.Convert.ToString); } if (content.Contains("ToChannelFromBotLoginUrl")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IHostSettingsResponseInternal)this).ToChannelFromBotLoginUrl = (string) content.GetValueForProperty("ToChannelFromBotLoginUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IHostSettingsResponseInternal)this).ToChannelFromBotLoginUrl, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IHostSettingsResponseInternal)this).ToChannelFromBotLoginUrl = (string) content.GetValueForProperty("ToChannelFromBotLoginUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IHostSettingsResponseInternal)this).ToChannelFromBotLoginUrl, global::System.Convert.ToString); } if (content.Contains("ToChannelFromBotOAuthScope")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IHostSettingsResponseInternal)this).ToChannelFromBotOAuthScope = (string) content.GetValueForProperty("ToChannelFromBotOAuthScope",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IHostSettingsResponseInternal)this).ToChannelFromBotOAuthScope, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IHostSettingsResponseInternal)this).ToChannelFromBotOAuthScope = (string) content.GetValueForProperty("ToChannelFromBotOAuthScope",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IHostSettingsResponseInternal)this).ToChannelFromBotOAuthScope, global::System.Convert.ToString); } if (content.Contains("ValidateAuthority")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IHostSettingsResponseInternal)this).ValidateAuthority = (bool?) content.GetValueForProperty("ValidateAuthority",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IHostSettingsResponseInternal)this).ValidateAuthority, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IHostSettingsResponseInternal)this).ValidateAuthority = (bool?) content.GetValueForProperty("ValidateAuthority",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IHostSettingsResponseInternal)this).ValidateAuthority, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("BotOpenIdMetadata")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IHostSettingsResponseInternal)this).BotOpenIdMetadata = (string) content.GetValueForProperty("BotOpenIdMetadata",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IHostSettingsResponseInternal)this).BotOpenIdMetadata, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IHostSettingsResponseInternal)this).BotOpenIdMetadata = (string) content.GetValueForProperty("BotOpenIdMetadata",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IHostSettingsResponseInternal)this).BotOpenIdMetadata, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -156,35 +162,35 @@ internal HostSettingsResponse(global::System.Management.Automation.PSObject cont // actually deserialize if (content.Contains("OAuthUrl")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IHostSettingsResponseInternal)this).OAuthUrl = (string) content.GetValueForProperty("OAuthUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IHostSettingsResponseInternal)this).OAuthUrl, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IHostSettingsResponseInternal)this).OAuthUrl = (string) content.GetValueForProperty("OAuthUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IHostSettingsResponseInternal)this).OAuthUrl, global::System.Convert.ToString); } if (content.Contains("ToBotFromChannelOpenIdMetadataUrl")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IHostSettingsResponseInternal)this).ToBotFromChannelOpenIdMetadataUrl = (string) content.GetValueForProperty("ToBotFromChannelOpenIdMetadataUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IHostSettingsResponseInternal)this).ToBotFromChannelOpenIdMetadataUrl, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IHostSettingsResponseInternal)this).ToBotFromChannelOpenIdMetadataUrl = (string) content.GetValueForProperty("ToBotFromChannelOpenIdMetadataUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IHostSettingsResponseInternal)this).ToBotFromChannelOpenIdMetadataUrl, global::System.Convert.ToString); } if (content.Contains("ToBotFromChannelTokenIssuer")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IHostSettingsResponseInternal)this).ToBotFromChannelTokenIssuer = (string) content.GetValueForProperty("ToBotFromChannelTokenIssuer",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IHostSettingsResponseInternal)this).ToBotFromChannelTokenIssuer, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IHostSettingsResponseInternal)this).ToBotFromChannelTokenIssuer = (string) content.GetValueForProperty("ToBotFromChannelTokenIssuer",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IHostSettingsResponseInternal)this).ToBotFromChannelTokenIssuer, global::System.Convert.ToString); } if (content.Contains("ToBotFromEmulatorOpenIdMetadataUrl")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IHostSettingsResponseInternal)this).ToBotFromEmulatorOpenIdMetadataUrl = (string) content.GetValueForProperty("ToBotFromEmulatorOpenIdMetadataUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IHostSettingsResponseInternal)this).ToBotFromEmulatorOpenIdMetadataUrl, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IHostSettingsResponseInternal)this).ToBotFromEmulatorOpenIdMetadataUrl = (string) content.GetValueForProperty("ToBotFromEmulatorOpenIdMetadataUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IHostSettingsResponseInternal)this).ToBotFromEmulatorOpenIdMetadataUrl, global::System.Convert.ToString); } if (content.Contains("ToChannelFromBotLoginUrl")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IHostSettingsResponseInternal)this).ToChannelFromBotLoginUrl = (string) content.GetValueForProperty("ToChannelFromBotLoginUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IHostSettingsResponseInternal)this).ToChannelFromBotLoginUrl, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IHostSettingsResponseInternal)this).ToChannelFromBotLoginUrl = (string) content.GetValueForProperty("ToChannelFromBotLoginUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IHostSettingsResponseInternal)this).ToChannelFromBotLoginUrl, global::System.Convert.ToString); } if (content.Contains("ToChannelFromBotOAuthScope")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IHostSettingsResponseInternal)this).ToChannelFromBotOAuthScope = (string) content.GetValueForProperty("ToChannelFromBotOAuthScope",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IHostSettingsResponseInternal)this).ToChannelFromBotOAuthScope, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IHostSettingsResponseInternal)this).ToChannelFromBotOAuthScope = (string) content.GetValueForProperty("ToChannelFromBotOAuthScope",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IHostSettingsResponseInternal)this).ToChannelFromBotOAuthScope, global::System.Convert.ToString); } if (content.Contains("ValidateAuthority")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IHostSettingsResponseInternal)this).ValidateAuthority = (bool?) content.GetValueForProperty("ValidateAuthority",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IHostSettingsResponseInternal)this).ValidateAuthority, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IHostSettingsResponseInternal)this).ValidateAuthority = (bool?) content.GetValueForProperty("ValidateAuthority",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IHostSettingsResponseInternal)this).ValidateAuthority, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("BotOpenIdMetadata")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IHostSettingsResponseInternal)this).BotOpenIdMetadata = (string) content.GetValueForProperty("BotOpenIdMetadata",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IHostSettingsResponseInternal)this).BotOpenIdMetadata, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IHostSettingsResponseInternal)this).BotOpenIdMetadata = (string) content.GetValueForProperty("BotOpenIdMetadata",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IHostSettingsResponseInternal)this).BotOpenIdMetadata, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -193,6 +199,18 @@ internal HostSettingsResponse(global::System.Management.Automation.PSObject cont /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.BotService.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 response body returned for a request to Bot Service Management to check per subscription hostSettings [System.ComponentModel.TypeConverter(typeof(HostSettingsResponseTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/HostSettingsResponse.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/HostSettingsResponse.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/HostSettingsResponse.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/HostSettingsResponse.TypeConverter.cs index 9380d5d1964c..e8b676e08dcf 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/HostSettingsResponse.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/HostSettingsResponse.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IHostSettingsResponse ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IHostSettingsResponse ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IHostSettingsResponse).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IHostSettingsResponse).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/HostSettingsResponse.cs b/generated/BotService/BotService.Autorest/generated/api/Models/HostSettingsResponse.cs similarity index 92% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/HostSettingsResponse.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/HostSettingsResponse.cs index 40b828229a4a..e00f7b57f341 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/HostSettingsResponse.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/HostSettingsResponse.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -11,8 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Previe /// The response body returned for a request to Bot Service Management to check per subscription hostSettings /// public partial class HostSettingsResponse : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IHostSettingsResponse, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IHostSettingsResponseInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IHostSettingsResponse, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IHostSettingsResponseInternal { /// Backing field for property. @@ -85,6 +85,9 @@ public partial interface IHostSettingsResponse : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Same as toBotFromChannelOpenIdMetadataUrl, used by SDK < v4.12", SerializedName = @"BotOpenIdMetadata", PossibleTypes = new [] { typeof(string) })] @@ -93,6 +96,9 @@ public partial interface IHostSettingsResponse : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"For in-conversation bot user authentication", SerializedName = @"OAuthUrl", PossibleTypes = new [] { typeof(string) })] @@ -101,6 +107,9 @@ public partial interface IHostSettingsResponse : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"For verifying incoming tokens from the channels", SerializedName = @"ToBotFromChannelOpenIdMetadataUrl", PossibleTypes = new [] { typeof(string) })] @@ -109,6 +118,9 @@ public partial interface IHostSettingsResponse : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"For verifying incoming tokens from the channels", SerializedName = @"ToBotFromChannelTokenIssuer", PossibleTypes = new [] { typeof(string) })] @@ -117,6 +129,9 @@ public partial interface IHostSettingsResponse : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"For verifying incoming tokens from bot emulator", SerializedName = @"ToBotFromEmulatorOpenIdMetadataUrl", PossibleTypes = new [] { typeof(string) })] @@ -125,6 +140,9 @@ public partial interface IHostSettingsResponse : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"For getting access token to channels from bot host", SerializedName = @"ToChannelFromBotLoginUrl", PossibleTypes = new [] { typeof(string) })] @@ -133,6 +151,9 @@ public partial interface IHostSettingsResponse : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"For getting access token to channels from bot host", SerializedName = @"ToChannelFromBotOAuthScope", PossibleTypes = new [] { typeof(string) })] @@ -141,6 +162,9 @@ public partial interface IHostSettingsResponse : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Per cloud OAuth setting on whether authority is validated", SerializedName = @"ValidateAuthority", PossibleTypes = new [] { typeof(bool) })] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/HostSettingsResponse.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/HostSettingsResponse.json.cs similarity index 92% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/HostSettingsResponse.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/HostSettingsResponse.json.cs index b6cd89ee6b28..bc2f6b43f30d 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/HostSettingsResponse.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/HostSettingsResponse.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class HostSettingsResponse partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IHostSettingsResponse. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IHostSettingsResponse. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IHostSettingsResponse. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IHostSettingsResponse. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IHostSettingsResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IHostSettingsResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new HostSettingsResponse(json) : null; } @@ -79,14 +79,14 @@ internal HostSettingsResponse(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runt { return; } - {_oAuthUrl = If( json?.PropertyT("OAuthUrl"), out var __jsonOAuthUrl) ? (string)__jsonOAuthUrl : (string)OAuthUrl;} - {_toBotFromChannelOpenIdMetadataUrl = If( json?.PropertyT("ToBotFromChannelOpenIdMetadataUrl"), out var __jsonToBotFromChannelOpenIdMetadataUrl) ? (string)__jsonToBotFromChannelOpenIdMetadataUrl : (string)ToBotFromChannelOpenIdMetadataUrl;} - {_toBotFromChannelTokenIssuer = If( json?.PropertyT("ToBotFromChannelTokenIssuer"), out var __jsonToBotFromChannelTokenIssuer) ? (string)__jsonToBotFromChannelTokenIssuer : (string)ToBotFromChannelTokenIssuer;} - {_toBotFromEmulatorOpenIdMetadataUrl = If( json?.PropertyT("ToBotFromEmulatorOpenIdMetadataUrl"), out var __jsonToBotFromEmulatorOpenIdMetadataUrl) ? (string)__jsonToBotFromEmulatorOpenIdMetadataUrl : (string)ToBotFromEmulatorOpenIdMetadataUrl;} - {_toChannelFromBotLoginUrl = If( json?.PropertyT("ToChannelFromBotLoginUrl"), out var __jsonToChannelFromBotLoginUrl) ? (string)__jsonToChannelFromBotLoginUrl : (string)ToChannelFromBotLoginUrl;} - {_toChannelFromBotOAuthScope = If( json?.PropertyT("ToChannelFromBotOAuthScope"), out var __jsonToChannelFromBotOAuthScope) ? (string)__jsonToChannelFromBotOAuthScope : (string)ToChannelFromBotOAuthScope;} - {_validateAuthority = If( json?.PropertyT("ValidateAuthority"), out var __jsonValidateAuthority) ? (bool?)__jsonValidateAuthority : ValidateAuthority;} - {_botOpenIdMetadata = If( json?.PropertyT("BotOpenIdMetadata"), out var __jsonBotOpenIdMetadata) ? (string)__jsonBotOpenIdMetadata : (string)BotOpenIdMetadata;} + {_oAuthUrl = If( json?.PropertyT("OAuthUrl"), out var __jsonOAuthUrl) ? (string)__jsonOAuthUrl : (string)_oAuthUrl;} + {_toBotFromChannelOpenIdMetadataUrl = If( json?.PropertyT("ToBotFromChannelOpenIdMetadataUrl"), out var __jsonToBotFromChannelOpenIdMetadataUrl) ? (string)__jsonToBotFromChannelOpenIdMetadataUrl : (string)_toBotFromChannelOpenIdMetadataUrl;} + {_toBotFromChannelTokenIssuer = If( json?.PropertyT("ToBotFromChannelTokenIssuer"), out var __jsonToBotFromChannelTokenIssuer) ? (string)__jsonToBotFromChannelTokenIssuer : (string)_toBotFromChannelTokenIssuer;} + {_toBotFromEmulatorOpenIdMetadataUrl = If( json?.PropertyT("ToBotFromEmulatorOpenIdMetadataUrl"), out var __jsonToBotFromEmulatorOpenIdMetadataUrl) ? (string)__jsonToBotFromEmulatorOpenIdMetadataUrl : (string)_toBotFromEmulatorOpenIdMetadataUrl;} + {_toChannelFromBotLoginUrl = If( json?.PropertyT("ToChannelFromBotLoginUrl"), out var __jsonToChannelFromBotLoginUrl) ? (string)__jsonToChannelFromBotLoginUrl : (string)_toChannelFromBotLoginUrl;} + {_toChannelFromBotOAuthScope = If( json?.PropertyT("ToChannelFromBotOAuthScope"), out var __jsonToChannelFromBotOAuthScope) ? (string)__jsonToChannelFromBotOAuthScope : (string)_toChannelFromBotOAuthScope;} + {_validateAuthority = If( json?.PropertyT("ValidateAuthority"), out var __jsonValidateAuthority) ? (bool?)__jsonValidateAuthority : _validateAuthority;} + {_botOpenIdMetadata = If( json?.PropertyT("BotOpenIdMetadata"), out var __jsonBotOpenIdMetadata) ? (string)__jsonBotOpenIdMetadata : (string)_botOpenIdMetadata;} AfterFromJson(json); } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/KikChannel.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/KikChannel.PowerShell.cs similarity index 60% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/KikChannel.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/KikChannel.PowerShell.cs index 52a72d037155..536e056e9527 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/KikChannel.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/KikChannel.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class KikChannel 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.BotService.Models.Api20220615Preview.IKikChannel DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannel DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new KikChannel(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.BotService.Models.Api20220615Preview.IKikChannel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new KikChannel(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Pr /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IKikChannel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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. @@ -103,45 +111,45 @@ internal KikChannel(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IKikChannelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IKikChannelProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IKikChannelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.KikChannelPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannelProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.KikChannelPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Etag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Etag, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Etag, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).ProvisioningState, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("UserName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IKikChannelInternal)this).UserName = (string) content.GetValueForProperty("UserName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IKikChannelInternal)this).UserName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannelInternal)this).UserName = (string) content.GetValueForProperty("UserName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannelInternal)this).UserName, global::System.Convert.ToString); } if (content.Contains("ApiKey")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IKikChannelInternal)this).ApiKey = (string) content.GetValueForProperty("ApiKey",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IKikChannelInternal)this).ApiKey, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannelInternal)this).ApiKey = (string) content.GetValueForProperty("ApiKey",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannelInternal)this).ApiKey, global::System.Convert.ToString); } if (content.Contains("IsValidated")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IKikChannelInternal)this).IsValidated = (bool?) content.GetValueForProperty("IsValidated",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IKikChannelInternal)this).IsValidated, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannelInternal)this).IsValidated = (bool?) content.GetValueForProperty("IsValidated",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannelInternal)this).IsValidated, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IKikChannelInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IKikChannelInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannelInternal)this).IsEnabled = (bool?) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannelInternal)this).IsEnabled, (__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,39 +164,39 @@ internal KikChannel(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IKikChannelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IKikChannelProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IKikChannelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.KikChannelPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannelProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.KikChannelPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Etag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Etag, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Etag, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).ProvisioningState, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("UserName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IKikChannelInternal)this).UserName = (string) content.GetValueForProperty("UserName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IKikChannelInternal)this).UserName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannelInternal)this).UserName = (string) content.GetValueForProperty("UserName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannelInternal)this).UserName, global::System.Convert.ToString); } if (content.Contains("ApiKey")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IKikChannelInternal)this).ApiKey = (string) content.GetValueForProperty("ApiKey",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IKikChannelInternal)this).ApiKey, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannelInternal)this).ApiKey = (string) content.GetValueForProperty("ApiKey",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannelInternal)this).ApiKey, global::System.Convert.ToString); } if (content.Contains("IsValidated")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IKikChannelInternal)this).IsValidated = (bool?) content.GetValueForProperty("IsValidated",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IKikChannelInternal)this).IsValidated, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannelInternal)this).IsValidated = (bool?) content.GetValueForProperty("IsValidated",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannelInternal)this).IsValidated, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IKikChannelInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IKikChannelInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannelInternal)this).IsEnabled = (bool?) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannelInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializePSObject(content); } @@ -197,6 +205,18 @@ internal KikChannel(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.BotService.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(); + } } /// Kik channel definition [System.ComponentModel.TypeConverter(typeof(KikChannelTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/KikChannel.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/KikChannel.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/KikChannel.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/KikChannel.TypeConverter.cs index 7d436ab2e322..3cb641290e66 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/KikChannel.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/KikChannel.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IKikChannel ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannel ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IKikChannel).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannel).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/KikChannel.cs b/generated/BotService/BotService.Autorest/generated/api/Models/KikChannel.cs similarity index 65% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/KikChannel.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/KikChannel.cs index 20a16e8b2c16..31fa41da31db 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/KikChannel.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/KikChannel.cs @@ -3,73 +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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// Kik channel definition public partial class KikChannel : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IKikChannel, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IKikChannelInternal, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannel, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannelInternal, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannel __channel = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Channel(); + private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannel __channel = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Channel(); /// /// Kik API key. Value only returned through POST to the action Channel List API, otherwise empty. /// [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string ApiKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IKikChannelPropertiesInternal)Property).ApiKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IKikChannelPropertiesInternal)Property).ApiKey = value ?? null; } + public string ApiKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannelPropertiesInternal)Property).ApiKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannelPropertiesInternal)Property).ApiKey = value ?? null; } /// Entity Tag of the resource [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Etag = value ?? null; } + public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Etag = value ?? null; } /// Whether this channel is enabled for the bot [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public bool? IsEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IKikChannelPropertiesInternal)Property).IsEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IKikChannelPropertiesInternal)Property).IsEnabled = value ?? default(bool); } + public bool? IsEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannelPropertiesInternal)Property).IsEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannelPropertiesInternal)Property).IsEnabled = value ?? default(bool); } /// Whether this channel is validated for the bot [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public bool? IsValidated { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IKikChannelPropertiesInternal)Property).IsValidated; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IKikChannelPropertiesInternal)Property).IsValidated = value ?? default(bool); } + public bool? IsValidated { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannelPropertiesInternal)Property).IsValidated; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannelPropertiesInternal)Property).IsValidated = value ?? default(bool); } /// Specifies the location of the resource. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Location = value ?? null; } + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Location = value ?? null; } /// Internal Acessors for ProvisioningState - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).ProvisioningState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).ProvisioningState = value; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IKikChannelProperties Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IKikChannelInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.KikChannelProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannelProperties Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannelInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.KikChannelProperties()); set { {_property = value;} } } /// The channel name + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Constant] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Name = value ; } + public string Name { get => "KikChannel"; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Name = "KikChannel"; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IKikChannelProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannelProperties _property; /// The set of properties specific to Kik channel resource [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IKikChannelProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.KikChannelProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannelProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.KikChannelProperties()); set => this._property = value; } /// Provisioning state of the resource [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).ProvisioningState; } + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).ProvisioningState; } /// The Kik user name [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string UserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IKikChannelPropertiesInternal)Property).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IKikChannelPropertiesInternal)Property).UserName = value ?? null; } + public string UserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannelPropertiesInternal)Property).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannelPropertiesInternal)Property).UserName = value ?? null; } /// Creates an new instance. public KikChannel() { - + this.__channel.Name = "KikChannel"; } /// Validates that this object meets the validation criteria. @@ -87,7 +87,7 @@ public KikChannel() /// Kik channel definition public partial interface IKikChannel : Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannel + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannel { /// /// Kik API key. Value only returned through POST to the action Channel List API, otherwise empty. @@ -95,6 +95,9 @@ public partial interface IKikChannel : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Kik API key. Value only returned through POST to the action Channel List API, otherwise empty.", SerializedName = @"apiKey", PossibleTypes = new [] { typeof(string) })] @@ -103,6 +106,9 @@ public partial interface IKikChannel : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Whether this channel is enabled for the bot", SerializedName = @"isEnabled", PossibleTypes = new [] { typeof(bool) })] @@ -111,6 +117,9 @@ public partial interface IKikChannel : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Whether this channel is validated for the bot", SerializedName = @"isValidated", PossibleTypes = new [] { typeof(bool) })] @@ -119,6 +128,9 @@ public partial interface IKikChannel : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The Kik user name", SerializedName = @"userName", PossibleTypes = new [] { typeof(string) })] @@ -127,7 +139,7 @@ public partial interface IKikChannel : } /// Kik channel definition internal partial interface IKikChannelInternal : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal { /// /// Kik API key. Value only returned through POST to the action Channel List API, otherwise empty. @@ -138,7 +150,7 @@ internal partial interface IKikChannelInternal : /// Whether this channel is validated for the bot bool? IsValidated { get; set; } /// The set of properties specific to Kik channel resource - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IKikChannelProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannelProperties Property { get; set; } /// The Kik user name string UserName { get; set; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/KikChannel.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/KikChannel.json.cs similarity index 93% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/KikChannel.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/KikChannel.json.cs index fee4c2f51fa6..b0371990aac6 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/KikChannel.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/KikChannel.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class KikChannel partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IKikChannel. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannel. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IKikChannel. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannel. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IKikChannel FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannel FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new KikChannel(json) : null; } @@ -77,8 +77,8 @@ internal KikChannel(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.J { return; } - __channel = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Channel(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.KikChannelProperties.FromJson(__jsonProperties) : Property;} + __channel = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Channel(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.KikChannelProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/KikChannelProperties.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/KikChannelProperties.PowerShell.cs similarity index 68% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/KikChannelProperties.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/KikChannelProperties.PowerShell.cs index 5f6275005a49..f3e212ebaba2 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/KikChannelProperties.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/KikChannelProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class KikChannelProperties 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.BotService.Models.Api20220615Preview.IKikChannelProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannelProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new KikChannelProperties(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.BotService.Models.Api20220615Preview.IKikChannelProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannelProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new KikChannelProperties(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Pr /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IKikChannelProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannelProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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 KikChannelProperties(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("UserName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IKikChannelPropertiesInternal)this).UserName = (string) content.GetValueForProperty("UserName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IKikChannelPropertiesInternal)this).UserName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannelPropertiesInternal)this).UserName = (string) content.GetValueForProperty("UserName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannelPropertiesInternal)this).UserName, global::System.Convert.ToString); } if (content.Contains("ApiKey")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IKikChannelPropertiesInternal)this).ApiKey = (string) content.GetValueForProperty("ApiKey",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IKikChannelPropertiesInternal)this).ApiKey, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannelPropertiesInternal)this).ApiKey = (string) content.GetValueForProperty("ApiKey",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannelPropertiesInternal)this).ApiKey, global::System.Convert.ToString); } if (content.Contains("IsValidated")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IKikChannelPropertiesInternal)this).IsValidated = (bool?) content.GetValueForProperty("IsValidated",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IKikChannelPropertiesInternal)this).IsValidated, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannelPropertiesInternal)this).IsValidated = (bool?) content.GetValueForProperty("IsValidated",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannelPropertiesInternal)this).IsValidated, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IKikChannelPropertiesInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IKikChannelPropertiesInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannelPropertiesInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannelPropertiesInternal)this).IsEnabled, (__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. @@ -138,19 +144,19 @@ internal KikChannelProperties(global::System.Management.Automation.PSObject cont // actually deserialize if (content.Contains("UserName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IKikChannelPropertiesInternal)this).UserName = (string) content.GetValueForProperty("UserName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IKikChannelPropertiesInternal)this).UserName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannelPropertiesInternal)this).UserName = (string) content.GetValueForProperty("UserName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannelPropertiesInternal)this).UserName, global::System.Convert.ToString); } if (content.Contains("ApiKey")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IKikChannelPropertiesInternal)this).ApiKey = (string) content.GetValueForProperty("ApiKey",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IKikChannelPropertiesInternal)this).ApiKey, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannelPropertiesInternal)this).ApiKey = (string) content.GetValueForProperty("ApiKey",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannelPropertiesInternal)this).ApiKey, global::System.Convert.ToString); } if (content.Contains("IsValidated")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IKikChannelPropertiesInternal)this).IsValidated = (bool?) content.GetValueForProperty("IsValidated",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IKikChannelPropertiesInternal)this).IsValidated, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannelPropertiesInternal)this).IsValidated = (bool?) content.GetValueForProperty("IsValidated",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannelPropertiesInternal)this).IsValidated, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IKikChannelPropertiesInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IKikChannelPropertiesInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannelPropertiesInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannelPropertiesInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializePSObject(content); } @@ -159,6 +165,18 @@ internal KikChannelProperties(global::System.Management.Automation.PSObject cont /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.BotService.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 parameters to provide for the Kik channel. [System.ComponentModel.TypeConverter(typeof(KikChannelPropertiesTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/KikChannelProperties.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/KikChannelProperties.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/KikChannelProperties.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/KikChannelProperties.TypeConverter.cs index 84af0c538c01..9c123d97511e 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/KikChannelProperties.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/KikChannelProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IKikChannelProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannelProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IKikChannelProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannelProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/KikChannelProperties.cs b/generated/BotService/BotService.Autorest/generated/api/Models/KikChannelProperties.cs similarity index 90% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/KikChannelProperties.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/KikChannelProperties.cs index 0c3926379880..2745a4ca2ce4 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/KikChannelProperties.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/KikChannelProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// The parameters to provide for the Kik channel. public partial class KikChannelProperties : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IKikChannelProperties, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IKikChannelPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannelProperties, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannelPropertiesInternal { /// Backing field for property. @@ -59,6 +59,9 @@ public partial interface IKikChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Kik API key. Value only returned through POST to the action Channel List API, otherwise empty.", SerializedName = @"apiKey", PossibleTypes = new [] { typeof(string) })] @@ -67,6 +70,9 @@ public partial interface IKikChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Whether this channel is enabled for the bot", SerializedName = @"isEnabled", PossibleTypes = new [] { typeof(bool) })] @@ -75,6 +81,9 @@ public partial interface IKikChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Whether this channel is validated for the bot", SerializedName = @"isValidated", PossibleTypes = new [] { typeof(bool) })] @@ -83,6 +92,9 @@ public partial interface IKikChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The Kik user name", SerializedName = @"userName", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/KikChannelProperties.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/KikChannelProperties.json.cs similarity index 93% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/KikChannelProperties.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/KikChannelProperties.json.cs index 1d66a81015b6..bbc5b839c8c0 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/KikChannelProperties.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/KikChannelProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class KikChannelProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IKikChannelProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannelProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IKikChannelProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannelProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IKikChannelProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IKikChannelProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new KikChannelProperties(json) : null; } @@ -77,10 +77,10 @@ internal KikChannelProperties(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runt { return; } - {_userName = If( json?.PropertyT("userName"), out var __jsonUserName) ? (string)__jsonUserName : (string)UserName;} - {_apiKey = If( json?.PropertyT("apiKey"), out var __jsonApiKey) ? (string)__jsonApiKey : (string)ApiKey;} - {_isValidated = If( json?.PropertyT("isValidated"), out var __jsonIsValidated) ? (bool?)__jsonIsValidated : IsValidated;} - {_isEnabled = If( json?.PropertyT("isEnabled"), out var __jsonIsEnabled) ? (bool)__jsonIsEnabled : IsEnabled;} + {_userName = If( json?.PropertyT("userName"), out var __jsonUserName) ? (string)__jsonUserName : (string)_userName;} + {_apiKey = If( json?.PropertyT("apiKey"), out var __jsonApiKey) ? (string)__jsonApiKey : (string)_apiKey;} + {_isValidated = If( json?.PropertyT("isValidated"), out var __jsonIsValidated) ? (bool?)__jsonIsValidated : _isValidated;} + {_isEnabled = If( json?.PropertyT("isEnabled"), out var __jsonIsEnabled) ? (bool)__jsonIsEnabled : _isEnabled;} AfterFromJson(json); } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/LineChannel.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/LineChannel.PowerShell.cs similarity index 59% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/LineChannel.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/LineChannel.PowerShell.cs index 4315b1d55493..e69aae11aea0 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/LineChannel.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/LineChannel.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class LineChannel 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.BotService.Models.Api20220615Preview.ILineChannel DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannel DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new LineChannel(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.BotService.Models.Api20220615Preview.ILineChannel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new LineChannel(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Pr /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineChannel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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. @@ -103,41 +111,41 @@ internal LineChannel(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineChannelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineChannelProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineChannelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.LineChannelPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannelProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.LineChannelPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Etag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Etag, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Etag, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).ProvisioningState, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("LineRegistration")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineChannelInternal)this).LineRegistration = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineRegistration[]) content.GetValueForProperty("LineRegistration",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineChannelInternal)this).LineRegistration, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.LineRegistrationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannelInternal)this).LineRegistration = (System.Collections.Generic.List) content.GetValueForProperty("LineRegistration",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannelInternal)this).LineRegistration, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.LineRegistrationTypeConverter.ConvertFrom)); } if (content.Contains("CallbackUrl")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineChannelInternal)this).CallbackUrl = (string) content.GetValueForProperty("CallbackUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineChannelInternal)this).CallbackUrl, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannelInternal)this).CallbackUrl = (string) content.GetValueForProperty("CallbackUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannelInternal)this).CallbackUrl, global::System.Convert.ToString); } if (content.Contains("IsValidated")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineChannelInternal)this).IsValidated = (bool?) content.GetValueForProperty("IsValidated",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineChannelInternal)this).IsValidated, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannelInternal)this).IsValidated = (bool?) content.GetValueForProperty("IsValidated",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannelInternal)this).IsValidated, (__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. @@ -152,35 +160,35 @@ internal LineChannel(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineChannelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineChannelProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineChannelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.LineChannelPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannelProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.LineChannelPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Etag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Etag, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Etag, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).ProvisioningState, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("LineRegistration")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineChannelInternal)this).LineRegistration = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineRegistration[]) content.GetValueForProperty("LineRegistration",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineChannelInternal)this).LineRegistration, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.LineRegistrationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannelInternal)this).LineRegistration = (System.Collections.Generic.List) content.GetValueForProperty("LineRegistration",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannelInternal)this).LineRegistration, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.LineRegistrationTypeConverter.ConvertFrom)); } if (content.Contains("CallbackUrl")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineChannelInternal)this).CallbackUrl = (string) content.GetValueForProperty("CallbackUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineChannelInternal)this).CallbackUrl, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannelInternal)this).CallbackUrl = (string) content.GetValueForProperty("CallbackUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannelInternal)this).CallbackUrl, global::System.Convert.ToString); } if (content.Contains("IsValidated")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineChannelInternal)this).IsValidated = (bool?) content.GetValueForProperty("IsValidated",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineChannelInternal)this).IsValidated, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannelInternal)this).IsValidated = (bool?) content.GetValueForProperty("IsValidated",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannelInternal)this).IsValidated, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializePSObject(content); } @@ -189,6 +197,18 @@ internal LineChannel(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.BotService.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(); + } } /// Line channel definition [System.ComponentModel.TypeConverter(typeof(LineChannelTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/LineChannel.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/LineChannel.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/LineChannel.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/LineChannel.TypeConverter.cs index 7f718bd8b2ce..05a97acbda1e 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/LineChannel.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/LineChannel.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.ILineChannel ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannel ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineChannel).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannel).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/LineChannel.cs b/generated/BotService/BotService.Autorest/generated/api/Models/LineChannel.cs similarity index 58% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/LineChannel.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/LineChannel.cs index d99f4a329a17..61766f386a52 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/LineChannel.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/LineChannel.cs @@ -3,73 +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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// Line channel definition public partial class LineChannel : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineChannel, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineChannelInternal, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannel, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannelInternal, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannel __channel = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Channel(); + private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannel __channel = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Channel(); /// Callback Url to enter in line registration. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string CallbackUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineChannelPropertiesInternal)Property).CallbackUrl; } + public string CallbackUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannelPropertiesInternal)Property).CallbackUrl; } /// Entity Tag of the resource [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Etag = value ?? null; } + public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Etag = value ?? null; } /// Whether this channel is validated for the bot [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public bool? IsValidated { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineChannelPropertiesInternal)Property).IsValidated; } + public bool? IsValidated { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannelPropertiesInternal)Property).IsValidated; } /// The list of line channel registrations [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineRegistration[] LineRegistration { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineChannelPropertiesInternal)Property).LineRegistration; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineChannelPropertiesInternal)Property).LineRegistration = value ?? null /* arrayOf */; } + public System.Collections.Generic.List LineRegistration { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannelPropertiesInternal)Property).LineRegistration; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannelPropertiesInternal)Property).LineRegistration = value ?? null /* arrayOf */; } /// Specifies the location of the resource. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Location = value ?? null; } + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Location = value ?? null; } /// Internal Acessors for ProvisioningState - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).ProvisioningState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).ProvisioningState = value; } /// Internal Acessors for CallbackUrl - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineChannelInternal.CallbackUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineChannelPropertiesInternal)Property).CallbackUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineChannelPropertiesInternal)Property).CallbackUrl = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannelInternal.CallbackUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannelPropertiesInternal)Property).CallbackUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannelPropertiesInternal)Property).CallbackUrl = value; } /// Internal Acessors for IsValidated - bool? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineChannelInternal.IsValidated { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineChannelPropertiesInternal)Property).IsValidated; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineChannelPropertiesInternal)Property).IsValidated = value; } + bool? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannelInternal.IsValidated { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannelPropertiesInternal)Property).IsValidated; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannelPropertiesInternal)Property).IsValidated = value; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineChannelProperties Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineChannelInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.LineChannelProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannelProperties Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannelInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.LineChannelProperties()); set { {_property = value;} } } /// The channel name + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Constant] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Name = value ; } + public string Name { get => "LineChannel"; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Name = "LineChannel"; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineChannelProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannelProperties _property; /// The set of properties specific to line channel resource [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineChannelProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.LineChannelProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannelProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.LineChannelProperties()); set => this._property = value; } /// Provisioning state of the resource [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).ProvisioningState; } + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).ProvisioningState; } /// Creates an new instance. public LineChannel() { - + this.__channel.Name = "LineChannel"; } /// Validates that this object meets the validation criteria. @@ -87,12 +87,15 @@ public LineChannel() /// Line channel definition public partial interface ILineChannel : Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannel + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannel { /// Callback Url to enter in line registration. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Callback Url to enter in line registration.", SerializedName = @"callbackUrl", PossibleTypes = new [] { typeof(string) })] @@ -101,6 +104,9 @@ public partial interface ILineChannel : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Whether this channel is validated for the bot", SerializedName = @"isValidated", PossibleTypes = new [] { typeof(bool) })] @@ -109,24 +115,27 @@ public partial interface ILineChannel : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of line channel registrations", SerializedName = @"lineRegistrations", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineRegistration) })] - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineRegistration[] LineRegistration { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineRegistration) })] + System.Collections.Generic.List LineRegistration { get; set; } } /// Line channel definition internal partial interface ILineChannelInternal : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal { /// Callback Url to enter in line registration. string CallbackUrl { get; set; } /// Whether this channel is validated for the bot bool? IsValidated { get; set; } /// The list of line channel registrations - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineRegistration[] LineRegistration { get; set; } + System.Collections.Generic.List LineRegistration { get; set; } /// The set of properties specific to line channel resource - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineChannelProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannelProperties Property { get; set; } } } \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/LineChannel.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/LineChannel.json.cs similarity index 93% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/LineChannel.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/LineChannel.json.cs index 159bc804202d..797c1519de5c 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/LineChannel.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/LineChannel.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class LineChannel partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineChannel. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannel. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineChannel. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannel. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineChannel FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannel FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new LineChannel(json) : null; } @@ -77,8 +77,8 @@ internal LineChannel(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json. { return; } - __channel = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Channel(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.LineChannelProperties.FromJson(__jsonProperties) : Property;} + __channel = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Channel(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.LineChannelProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/LineChannelProperties.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/LineChannelProperties.PowerShell.cs similarity index 66% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/LineChannelProperties.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/LineChannelProperties.PowerShell.cs index 766fd40dac3d..75e832e0cb51 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/LineChannelProperties.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/LineChannelProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class LineChannelProperties 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.BotService.Models.Api20220615Preview.ILineChannelProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannelProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new LineChannelProperties(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.BotService.Models.Api20220615Preview.ILineChannelProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannelProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new LineChannelProperties(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Pr /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineChannelProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannelProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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 LineChannelProperties(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("LineRegistration")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineChannelPropertiesInternal)this).LineRegistration = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineRegistration[]) content.GetValueForProperty("LineRegistration",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineChannelPropertiesInternal)this).LineRegistration, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.LineRegistrationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannelPropertiesInternal)this).LineRegistration = (System.Collections.Generic.List) content.GetValueForProperty("LineRegistration",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannelPropertiesInternal)this).LineRegistration, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.LineRegistrationTypeConverter.ConvertFrom)); } if (content.Contains("CallbackUrl")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineChannelPropertiesInternal)this).CallbackUrl = (string) content.GetValueForProperty("CallbackUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineChannelPropertiesInternal)this).CallbackUrl, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannelPropertiesInternal)this).CallbackUrl = (string) content.GetValueForProperty("CallbackUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannelPropertiesInternal)this).CallbackUrl, global::System.Convert.ToString); } if (content.Contains("IsValidated")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineChannelPropertiesInternal)this).IsValidated = (bool?) content.GetValueForProperty("IsValidated",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineChannelPropertiesInternal)this).IsValidated, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannelPropertiesInternal)this).IsValidated = (bool?) content.GetValueForProperty("IsValidated",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannelPropertiesInternal)this).IsValidated, (__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. @@ -134,15 +140,15 @@ internal LineChannelProperties(global::System.Management.Automation.PSObject con // actually deserialize if (content.Contains("LineRegistration")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineChannelPropertiesInternal)this).LineRegistration = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineRegistration[]) content.GetValueForProperty("LineRegistration",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineChannelPropertiesInternal)this).LineRegistration, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.LineRegistrationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannelPropertiesInternal)this).LineRegistration = (System.Collections.Generic.List) content.GetValueForProperty("LineRegistration",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannelPropertiesInternal)this).LineRegistration, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.LineRegistrationTypeConverter.ConvertFrom)); } if (content.Contains("CallbackUrl")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineChannelPropertiesInternal)this).CallbackUrl = (string) content.GetValueForProperty("CallbackUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineChannelPropertiesInternal)this).CallbackUrl, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannelPropertiesInternal)this).CallbackUrl = (string) content.GetValueForProperty("CallbackUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannelPropertiesInternal)this).CallbackUrl, global::System.Convert.ToString); } if (content.Contains("IsValidated")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineChannelPropertiesInternal)this).IsValidated = (bool?) content.GetValueForProperty("IsValidated",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineChannelPropertiesInternal)this).IsValidated, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannelPropertiesInternal)this).IsValidated = (bool?) content.GetValueForProperty("IsValidated",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannelPropertiesInternal)this).IsValidated, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializePSObject(content); } @@ -151,6 +157,18 @@ internal LineChannelProperties(global::System.Management.Automation.PSObject con /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.BotService.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 parameters to provide for the Line channel. [System.ComponentModel.TypeConverter(typeof(LineChannelPropertiesTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/LineChannelProperties.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/LineChannelProperties.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/LineChannelProperties.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/LineChannelProperties.TypeConverter.cs index 41019997b88d..17690f5dd3b6 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/LineChannelProperties.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/LineChannelProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.ILineChannelProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannelProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineChannelProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannelProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/LineChannelProperties.cs b/generated/BotService/BotService.Autorest/generated/api/Models/LineChannelProperties.cs similarity index 73% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/LineChannelProperties.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/LineChannelProperties.cs index 74255885c0ff..db009a1df002 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/LineChannelProperties.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/LineChannelProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// The parameters to provide for the Line channel. public partial class LineChannelProperties : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineChannelProperties, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineChannelPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannelProperties, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannelPropertiesInternal { /// Backing field for property. @@ -28,17 +28,17 @@ public partial class LineChannelProperties : public bool? IsValidated { get => this._isValidated; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineRegistration[] _lineRegistration; + private System.Collections.Generic.List _lineRegistration; /// The list of line channel registrations [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineRegistration[] LineRegistration { get => this._lineRegistration; set => this._lineRegistration = value; } + public System.Collections.Generic.List LineRegistration { get => this._lineRegistration; set => this._lineRegistration = value; } /// Internal Acessors for CallbackUrl - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineChannelPropertiesInternal.CallbackUrl { get => this._callbackUrl; set { {_callbackUrl = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannelPropertiesInternal.CallbackUrl { get => this._callbackUrl; set { {_callbackUrl = value;} } } /// Internal Acessors for IsValidated - bool? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineChannelPropertiesInternal.IsValidated { get => this._isValidated; set { {_isValidated = value;} } } + bool? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannelPropertiesInternal.IsValidated { get => this._isValidated; set { {_isValidated = value;} } } /// Creates an new instance. public LineChannelProperties() @@ -54,6 +54,9 @@ public partial interface ILineChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Callback Url to enter in line registration.", SerializedName = @"callbackUrl", PossibleTypes = new [] { typeof(string) })] @@ -62,6 +65,9 @@ public partial interface ILineChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Whether this channel is validated for the bot", SerializedName = @"isValidated", PossibleTypes = new [] { typeof(bool) })] @@ -70,10 +76,13 @@ public partial interface ILineChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of line channel registrations", SerializedName = @"lineRegistrations", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineRegistration) })] - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineRegistration[] LineRegistration { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineRegistration) })] + System.Collections.Generic.List LineRegistration { get; set; } } /// The parameters to provide for the Line channel. @@ -85,7 +94,7 @@ internal partial interface ILineChannelPropertiesInternal /// Whether this channel is validated for the bot bool? IsValidated { get; set; } /// The list of line channel registrations - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineRegistration[] LineRegistration { get; set; } + System.Collections.Generic.List LineRegistration { get; set; } } } \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/LineChannelProperties.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/LineChannelProperties.json.cs similarity index 89% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/LineChannelProperties.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/LineChannelProperties.json.cs index b8c4625de06d..5acc935b6a34 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/LineChannelProperties.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/LineChannelProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class LineChannelProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineChannelProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannelProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineChannelProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannelProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineChannelProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineChannelProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new LineChannelProperties(json) : null; } @@ -77,9 +77,9 @@ internal LineChannelProperties(Microsoft.Azure.PowerShell.Cmdlets.BotService.Run { return; } - {_lineRegistration = If( json?.PropertyT("lineRegistrations"), out var __jsonLineRegistrations) ? If( __jsonLineRegistrations as Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.ILineRegistration) (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.LineRegistration.FromJson(__u) )) ))() : null : LineRegistration;} - {_callbackUrl = If( json?.PropertyT("callbackUrl"), out var __jsonCallbackUrl) ? (string)__jsonCallbackUrl : (string)CallbackUrl;} - {_isValidated = If( json?.PropertyT("isValidated"), out var __jsonIsValidated) ? (bool?)__jsonIsValidated : IsValidated;} + {_lineRegistration = If( json?.PropertyT("lineRegistrations"), out var __jsonLineRegistrations) ? If( __jsonLineRegistrations as Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.ILineRegistration) (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.LineRegistration.FromJson(__u) )) ))() : null : _lineRegistration;} + {_callbackUrl = If( json?.PropertyT("callbackUrl"), out var __jsonCallbackUrl) ? (string)__jsonCallbackUrl : (string)_callbackUrl;} + {_isValidated = If( json?.PropertyT("isValidated"), out var __jsonIsValidated) ? (bool?)__jsonIsValidated : _isValidated;} AfterFromJson(json); } @@ -111,11 +111,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode ToJso } container.Add("lineRegistrations",__w); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._callbackUrl)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._callbackUrl.ToString()) : null, "callbackUrl" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._isValidated ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonBoolean((bool)this._isValidated) : null, "isValidated" ,container.Add ); } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/LineRegistration.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/LineRegistration.PowerShell.cs similarity index 71% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/LineRegistration.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/LineRegistration.PowerShell.cs index 540fc450ae6b..407cc862b876 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/LineRegistration.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/LineRegistration.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class LineRegistration 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.BotService.Models.Api20220615Preview.ILineRegistration DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineRegistration DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new LineRegistration(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.BotService.Models.Api20220615Preview.ILineRegistration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineRegistration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new LineRegistration(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Pr /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineRegistration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineRegistration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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. @@ -103,21 +111,21 @@ internal LineRegistration(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("GeneratedId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineRegistrationInternal)this).GeneratedId = (string) content.GetValueForProperty("GeneratedId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineRegistrationInternal)this).GeneratedId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineRegistrationInternal)this).GeneratedId = (string) content.GetValueForProperty("GeneratedId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineRegistrationInternal)this).GeneratedId, global::System.Convert.ToString); } if (content.Contains("ChannelSecret")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineRegistrationInternal)this).ChannelSecret = (string) content.GetValueForProperty("ChannelSecret",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineRegistrationInternal)this).ChannelSecret, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineRegistrationInternal)this).ChannelSecret = (string) content.GetValueForProperty("ChannelSecret",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineRegistrationInternal)this).ChannelSecret, global::System.Convert.ToString); } if (content.Contains("ChannelAccessToken")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineRegistrationInternal)this).ChannelAccessToken = (string) content.GetValueForProperty("ChannelAccessToken",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineRegistrationInternal)this).ChannelAccessToken, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineRegistrationInternal)this).ChannelAccessToken = (string) content.GetValueForProperty("ChannelAccessToken",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineRegistrationInternal)this).ChannelAccessToken, 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,15 +140,15 @@ internal LineRegistration(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("GeneratedId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineRegistrationInternal)this).GeneratedId = (string) content.GetValueForProperty("GeneratedId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineRegistrationInternal)this).GeneratedId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineRegistrationInternal)this).GeneratedId = (string) content.GetValueForProperty("GeneratedId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineRegistrationInternal)this).GeneratedId, global::System.Convert.ToString); } if (content.Contains("ChannelSecret")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineRegistrationInternal)this).ChannelSecret = (string) content.GetValueForProperty("ChannelSecret",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineRegistrationInternal)this).ChannelSecret, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineRegistrationInternal)this).ChannelSecret = (string) content.GetValueForProperty("ChannelSecret",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineRegistrationInternal)this).ChannelSecret, global::System.Convert.ToString); } if (content.Contains("ChannelAccessToken")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineRegistrationInternal)this).ChannelAccessToken = (string) content.GetValueForProperty("ChannelAccessToken",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineRegistrationInternal)this).ChannelAccessToken, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineRegistrationInternal)this).ChannelAccessToken = (string) content.GetValueForProperty("ChannelAccessToken",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineRegistrationInternal)this).ChannelAccessToken, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -149,6 +157,18 @@ internal LineRegistration(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.BotService.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 properties corresponding to a line channel registration [System.ComponentModel.TypeConverter(typeof(LineRegistrationTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/LineRegistration.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/LineRegistration.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/LineRegistration.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/LineRegistration.TypeConverter.cs index fe1457879bac..d518ea07e220 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/LineRegistration.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/LineRegistration.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.ILineRegistration ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineRegistration ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineRegistration).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineRegistration).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/LineRegistration.cs b/generated/BotService/BotService.Autorest/generated/api/Models/LineRegistration.cs similarity index 88% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/LineRegistration.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/LineRegistration.cs index 5eb6eec30c47..158e7fecf042 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/LineRegistration.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/LineRegistration.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// The properties corresponding to a line channel registration public partial class LineRegistration : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineRegistration, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineRegistrationInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineRegistration, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineRegistrationInternal { /// Backing field for property. @@ -35,7 +35,7 @@ public partial class LineRegistration : public string GeneratedId { get => this._generatedId; } /// Internal Acessors for GeneratedId - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineRegistrationInternal.GeneratedId { get => this._generatedId; set { {_generatedId = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineRegistrationInternal.GeneratedId { get => this._generatedId; set { {_generatedId = value;} } } /// Creates an new instance. public LineRegistration() @@ -51,6 +51,9 @@ public partial interface ILineRegistration : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Access token for the line channel registration", SerializedName = @"channelAccessToken", PossibleTypes = new [] { typeof(string) })] @@ -59,6 +62,9 @@ public partial interface ILineRegistration : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Secret for the line channel registration", SerializedName = @"channelSecret", PossibleTypes = new [] { typeof(string) })] @@ -67,6 +73,9 @@ public partial interface ILineRegistration : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Id generated for the line channel registration", SerializedName = @"generatedId", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/LineRegistration.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/LineRegistration.json.cs similarity index 93% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/LineRegistration.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/LineRegistration.json.cs index 4aa984c0e9a6..bb34b6925156 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/LineRegistration.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/LineRegistration.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class LineRegistration partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineRegistration. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineRegistration. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineRegistration. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineRegistration. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ILineRegistration FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ILineRegistration FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new LineRegistration(json) : null; } @@ -77,9 +77,9 @@ internal LineRegistration(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime. { return; } - {_generatedId = If( json?.PropertyT("generatedId"), out var __jsonGeneratedId) ? (string)__jsonGeneratedId : (string)GeneratedId;} - {_channelSecret = If( json?.PropertyT("channelSecret"), out var __jsonChannelSecret) ? (string)__jsonChannelSecret : (string)ChannelSecret;} - {_channelAccessToken = If( json?.PropertyT("channelAccessToken"), out var __jsonChannelAccessToken) ? (string)__jsonChannelAccessToken : (string)ChannelAccessToken;} + {_generatedId = If( json?.PropertyT("generatedId"), out var __jsonGeneratedId) ? (string)__jsonGeneratedId : (string)_generatedId;} + {_channelSecret = If( json?.PropertyT("channelSecret"), out var __jsonChannelSecret) ? (string)__jsonChannelSecret : (string)_channelSecret;} + {_channelAccessToken = If( json?.PropertyT("channelAccessToken"), out var __jsonChannelAccessToken) ? (string)__jsonChannelAccessToken : (string)_channelAccessToken;} AfterFromJson(json); } @@ -102,7 +102,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode ToJso { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._generatedId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._generatedId.ToString()) : null, "generatedId" ,container.Add ); } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/ListChannelWithKeysResponse.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/ListChannelWithKeysResponse.PowerShell.cs new file mode 100644 index 000000000000..f3c219edef19 --- /dev/null +++ b/generated/BotService/BotService.Autorest/generated/api/Models/ListChannelWithKeysResponse.PowerShell.cs @@ -0,0 +1,428 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; + + /// The ARM channel of list channel with keys operation response. + [System.ComponentModel.TypeConverter(typeof(ListChannelWithKeysResponseTypeConverter))] + public partial class ListChannelWithKeysResponse + { + + /// + /// 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.BotService.Models.IListChannelWithKeysResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ListChannelWithKeysResponse(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.BotService.Models.IListChannelWithKeysResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ListChannelWithKeysResponse(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.BotService.Models.IListChannelWithKeysResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ListChannelWithKeysResponse(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Resource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).Resource = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannel) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).Resource, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ChannelTypeConverter.ConvertFrom); + } + if (content.Contains("Setting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).Setting = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettings) content.GetValueForProperty("Setting",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).Setting, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ChannelSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("EntityTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).EntityTag = (string) content.GetValueForProperty("EntityTag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).EntityTag, global::System.Convert.ToString); + } + if (content.Contains("ChangedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).ChangedTime = (string) content.GetValueForProperty("ChangedTime",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).ChangedTime, global::System.Convert.ToString); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).SkuName, global::System.Convert.ToString); + } + if (content.Contains("SkuTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).SkuTier = (string) content.GetValueForProperty("SkuTier",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).SkuTier, global::System.Convert.ToString); + } + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.SkuTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Kind = (string) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Kind, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Zone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Zone = (System.Collections.Generic.List) content.GetValueForProperty("Zone",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Zone, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("ChannelName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannelInternal)this).ChannelName = (string) content.GetValueForProperty("ChannelName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannelInternal)this).ChannelName, global::System.Convert.ToString); + } + if (content.Contains("PropertiesEtag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannelInternal)this).PropertiesEtag = (string) content.GetValueForProperty("PropertiesEtag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannelInternal)this).PropertiesEtag, global::System.Convert.ToString); + } + if (content.Contains("PropertiesProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannelInternal)this).PropertiesProvisioningState = (string) content.GetValueForProperty("PropertiesProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannelInternal)this).PropertiesProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("PropertiesLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannelInternal)this).PropertiesLocation = (string) content.GetValueForProperty("PropertiesLocation",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannelInternal)this).PropertiesLocation, global::System.Convert.ToString); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannel) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ChannelTypeConverter.ConvertFrom); + } + if (content.Contains("ResourceChannelName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).ResourceChannelName = (string) content.GetValueForProperty("ResourceChannelName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).ResourceChannelName, global::System.Convert.ToString); + } + if (content.Contains("ResourceEtag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).ResourceEtag = (string) content.GetValueForProperty("ResourceEtag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).ResourceEtag, global::System.Convert.ToString); + } + if (content.Contains("ResourceProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).ResourceProvisioningState = (string) content.GetValueForProperty("ResourceProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).ResourceProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("ResourceLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).ResourceLocation = (string) content.GetValueForProperty("ResourceLocation",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).ResourceLocation, global::System.Convert.ToString); + } + if (content.Contains("SettingExtensionKey1")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).SettingExtensionKey1 = (string) content.GetValueForProperty("SettingExtensionKey1",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).SettingExtensionKey1, global::System.Convert.ToString); + } + if (content.Contains("SettingExtensionKey2")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).SettingExtensionKey2 = (string) content.GetValueForProperty("SettingExtensionKey2",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).SettingExtensionKey2, global::System.Convert.ToString); + } + if (content.Contains("SettingSite")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).SettingSite = (System.Collections.Generic.List) content.GetValueForProperty("SettingSite",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).SettingSite, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.SiteTypeConverter.ConvertFrom)); + } + if (content.Contains("SettingChannelId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).SettingChannelId = (string) content.GetValueForProperty("SettingChannelId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).SettingChannelId, global::System.Convert.ToString); + } + if (content.Contains("SettingChannelDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).SettingChannelDisplayName = (string) content.GetValueForProperty("SettingChannelDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).SettingChannelDisplayName, global::System.Convert.ToString); + } + if (content.Contains("SettingBotId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).SettingBotId = (string) content.GetValueForProperty("SettingBotId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).SettingBotId, global::System.Convert.ToString); + } + if (content.Contains("SettingBotIconUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).SettingBotIconUrl = (string) content.GetValueForProperty("SettingBotIconUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).SettingBotIconUrl, global::System.Convert.ToString); + } + if (content.Contains("SettingIsEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).SettingIsEnabled = (bool?) content.GetValueForProperty("SettingIsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).SettingIsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SettingDisableLocalAuth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).SettingDisableLocalAuth = (bool?) content.GetValueForProperty("SettingDisableLocalAuth",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).SettingDisableLocalAuth, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ListChannelWithKeysResponse(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Resource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).Resource = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannel) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).Resource, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ChannelTypeConverter.ConvertFrom); + } + if (content.Contains("Setting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).Setting = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettings) content.GetValueForProperty("Setting",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).Setting, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ChannelSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("EntityTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).EntityTag = (string) content.GetValueForProperty("EntityTag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).EntityTag, global::System.Convert.ToString); + } + if (content.Contains("ChangedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).ChangedTime = (string) content.GetValueForProperty("ChangedTime",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).ChangedTime, global::System.Convert.ToString); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).SkuName, global::System.Convert.ToString); + } + if (content.Contains("SkuTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).SkuTier = (string) content.GetValueForProperty("SkuTier",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).SkuTier, global::System.Convert.ToString); + } + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.SkuTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Kind = (string) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Kind, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Zone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Zone = (System.Collections.Generic.List) content.GetValueForProperty("Zone",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Zone, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("ChannelName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannelInternal)this).ChannelName = (string) content.GetValueForProperty("ChannelName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannelInternal)this).ChannelName, global::System.Convert.ToString); + } + if (content.Contains("PropertiesEtag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannelInternal)this).PropertiesEtag = (string) content.GetValueForProperty("PropertiesEtag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannelInternal)this).PropertiesEtag, global::System.Convert.ToString); + } + if (content.Contains("PropertiesProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannelInternal)this).PropertiesProvisioningState = (string) content.GetValueForProperty("PropertiesProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannelInternal)this).PropertiesProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("PropertiesLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannelInternal)this).PropertiesLocation = (string) content.GetValueForProperty("PropertiesLocation",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannelInternal)this).PropertiesLocation, global::System.Convert.ToString); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannel) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ChannelTypeConverter.ConvertFrom); + } + if (content.Contains("ResourceChannelName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).ResourceChannelName = (string) content.GetValueForProperty("ResourceChannelName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).ResourceChannelName, global::System.Convert.ToString); + } + if (content.Contains("ResourceEtag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).ResourceEtag = (string) content.GetValueForProperty("ResourceEtag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).ResourceEtag, global::System.Convert.ToString); + } + if (content.Contains("ResourceProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).ResourceProvisioningState = (string) content.GetValueForProperty("ResourceProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).ResourceProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("ResourceLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).ResourceLocation = (string) content.GetValueForProperty("ResourceLocation",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).ResourceLocation, global::System.Convert.ToString); + } + if (content.Contains("SettingExtensionKey1")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).SettingExtensionKey1 = (string) content.GetValueForProperty("SettingExtensionKey1",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).SettingExtensionKey1, global::System.Convert.ToString); + } + if (content.Contains("SettingExtensionKey2")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).SettingExtensionKey2 = (string) content.GetValueForProperty("SettingExtensionKey2",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).SettingExtensionKey2, global::System.Convert.ToString); + } + if (content.Contains("SettingSite")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).SettingSite = (System.Collections.Generic.List) content.GetValueForProperty("SettingSite",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).SettingSite, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.SiteTypeConverter.ConvertFrom)); + } + if (content.Contains("SettingChannelId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).SettingChannelId = (string) content.GetValueForProperty("SettingChannelId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).SettingChannelId, global::System.Convert.ToString); + } + if (content.Contains("SettingChannelDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).SettingChannelDisplayName = (string) content.GetValueForProperty("SettingChannelDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).SettingChannelDisplayName, global::System.Convert.ToString); + } + if (content.Contains("SettingBotId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).SettingBotId = (string) content.GetValueForProperty("SettingBotId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).SettingBotId, global::System.Convert.ToString); + } + if (content.Contains("SettingBotIconUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).SettingBotIconUrl = (string) content.GetValueForProperty("SettingBotIconUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).SettingBotIconUrl, global::System.Convert.ToString); + } + if (content.Contains("SettingIsEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).SettingIsEnabled = (bool?) content.GetValueForProperty("SettingIsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).SettingIsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SettingDisableLocalAuth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).SettingDisableLocalAuth = (bool?) content.GetValueForProperty("SettingDisableLocalAuth",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal)this).SettingDisableLocalAuth, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.BotService.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 ARM channel of list channel with keys operation response. + [System.ComponentModel.TypeConverter(typeof(ListChannelWithKeysResponseTypeConverter))] + public partial interface IListChannelWithKeysResponse + + { + + } +} \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ListChannelWithKeysResponse.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/ListChannelWithKeysResponse.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ListChannelWithKeysResponse.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/ListChannelWithKeysResponse.TypeConverter.cs index 377fc7996d24..33a05b38466c 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ListChannelWithKeysResponse.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/ListChannelWithKeysResponse.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IListChannelWithKeysResponse ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponse ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponse).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponse).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ListChannelWithKeysResponse.cs b/generated/BotService/BotService.Autorest/generated/api/Models/ListChannelWithKeysResponse.cs similarity index 61% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ListChannelWithKeysResponse.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/ListChannelWithKeysResponse.cs index 52bc064e75f4..81edfd326fcc 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ListChannelWithKeysResponse.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/ListChannelWithKeysResponse.cs @@ -3,21 +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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// The ARM channel of list channel with keys operation response. public partial class ListChannelWithKeysResponse : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponse, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponse, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannel __botChannel = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.BotChannel(); + private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannel __botChannel = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.BotChannel(); /// Backing field for property. private string _changedTime; @@ -28,7 +27,7 @@ public partial class ListChannelWithKeysResponse : /// The channel name [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string ChannelName { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannelInternal)__botChannel).ChannelName; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannelInternal)__botChannel).ChannelName = value ?? null; } + public string ChannelName { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannelInternal)__botChannel).ChannelName; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannelInternal)__botChannel).ChannelName = value ?? null; } /// Backing field for property. private string _entityTag; @@ -39,72 +38,78 @@ public partial class ListChannelWithKeysResponse : /// Entity Tag [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__botChannel).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__botChannel).Etag = value ?? null; } + public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__botChannel).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__botChannel).Etag = value ?? null; } /// Specifies the resource ID. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__botChannel).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__botChannel).Id; } /// Required. Gets or sets the Kind of the resource. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Kind? Kind { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__botChannel).Kind; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__botChannel).Kind = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Kind)""); } + public string Kind { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__botChannel).Kind; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__botChannel).Kind = value ?? null; } /// Specifies the location of the resource. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__botChannel).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__botChannel).Location = value ?? null; } + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__botChannel).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__botChannel).Location = value ?? null; } /// Internal Acessors for PropertiesProvisioningState - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannelInternal.PropertiesProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannelInternal)__botChannel).PropertiesProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannelInternal)__botChannel).PropertiesProvisioningState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannelInternal.PropertiesProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannelInternal)__botChannel).PropertiesProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannelInternal)__botChannel).PropertiesProvisioningState = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannel Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannelInternal.Property { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannelInternal)__botChannel).Property; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannelInternal)__botChannel).Property = value; } /// Internal Acessors for Resource - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannel Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal.Resource { get => (this._resource = this._resource ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Channel()); set { {_resource = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannel Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal.Resource { get => (this._resource = this._resource ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Channel()); set { {_resource = value;} } } /// Internal Acessors for ResourceProvisioningState - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal.ResourceProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)Resource).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)Resource).ProvisioningState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal.ResourceProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)Resource).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)Resource).ProvisioningState = value; } /// Internal Acessors for Setting - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettings Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal.Setting { get => (this._setting = this._setting ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ChannelSettings()); set { {_setting = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettings Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal.Setting { get => (this._setting = this._setting ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ChannelSettings()); set { {_setting = value;} } } /// Internal Acessors for SettingExtensionKey1 - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal.SettingExtensionKey1 { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettingsInternal)Setting).ExtensionKey1; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettingsInternal)Setting).ExtensionKey1 = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal.SettingExtensionKey1 { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettingsInternal)Setting).ExtensionKey1; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettingsInternal)Setting).ExtensionKey1 = value; } /// Internal Acessors for SettingExtensionKey2 - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponseInternal.SettingExtensionKey2 { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettingsInternal)Setting).ExtensionKey2; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettingsInternal)Setting).ExtensionKey2 = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponseInternal.SettingExtensionKey2 { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettingsInternal)Setting).ExtensionKey2; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettingsInternal)Setting).ExtensionKey2 = value; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__botChannel).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__botChannel).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__botChannel).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__botChannel).Id = value; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__botChannel).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__botChannel).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__botChannel).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__botChannel).Name = value; } + + /// Internal Acessors for Sku + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISku Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal.Sku { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__botChannel).Sku; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__botChannel).Sku = value; } /// Internal Acessors for SkuTier - Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuTier? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal.SkuTier { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__botChannel).SkuTier; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__botChannel).SkuTier = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal.SkuTier { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__botChannel).SkuTier; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__botChannel).SkuTier = value; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__botChannel).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__botChannel).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__botChannel).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__botChannel).Type = value; } /// Internal Acessors for Zone - string[] Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal.Zone { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__botChannel).Zone; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__botChannel).Zone = value; } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal.Zone { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__botChannel).Zone; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__botChannel).Zone = value; } /// Specifies the name of the resource. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__botChannel).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__botChannel).Name; } /// Entity Tag of the resource [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string PropertiesEtag { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannelInternal)__botChannel).PropertiesEtag; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannelInternal)__botChannel).PropertiesEtag = value ?? null; } + public string PropertiesEtag { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannelInternal)__botChannel).PropertiesEtag; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannelInternal)__botChannel).PropertiesEtag = value ?? null; } /// Specifies the location of the resource. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string PropertiesLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannelInternal)__botChannel).PropertiesLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannelInternal)__botChannel).PropertiesLocation = value ?? null; } + public string PropertiesLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannelInternal)__botChannel).PropertiesLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannelInternal)__botChannel).PropertiesLocation = value ?? null; } /// Provisioning state of the resource [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string PropertiesProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannelInternal)__botChannel).PropertiesProvisioningState; } + public string PropertiesProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannelInternal)__botChannel).PropertiesProvisioningState; } /// The set of properties specific to bot channel resource [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannel Property { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannelInternal)__botChannel).Property; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannelInternal)__botChannel).Property = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannel Property { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannelInternal)__botChannel).Property; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannelInternal)__botChannel).Property = value ?? null /* model class */; } /// Backing field for property. private string _provisioningState; @@ -114,96 +119,100 @@ public partial class ListChannelWithKeysResponse : public string ProvisioningState { get => this._provisioningState; set => this._provisioningState = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannel _resource; + private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannel _resource; /// The set of properties specific to bot channel resource [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannel Resource { get => (this._resource = this._resource ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Channel()); set => this._resource = value; } + public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannel Resource { get => (this._resource = this._resource ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Channel()); set => this._resource = value; } /// The channel name [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string ResourceChannelName { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)Resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)Resource).Name = value ?? null; } + public string ResourceChannelName { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)Resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)Resource).Name = value ?? null; } /// Entity Tag of the resource [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string ResourceEtag { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)Resource).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)Resource).Etag = value ?? null; } + public string ResourceEtag { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)Resource).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)Resource).Etag = value ?? null; } + + /// Gets the resource group name + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.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); } /// Specifies the location of the resource. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string ResourceLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)Resource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)Resource).Location = value ?? null; } + public string ResourceLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)Resource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)Resource).Location = value ?? null; } /// Provisioning state of the resource [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string ResourceProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)Resource).ProvisioningState; } + public string ResourceProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)Resource).ProvisioningState; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettings _setting; + private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettings _setting; /// Channel settings [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettings Setting { get => (this._setting = this._setting ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ChannelSettings()); set => this._setting = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettings Setting { get => (this._setting = this._setting ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ChannelSettings()); set => this._setting = value; } /// The bot icon url [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string SettingBotIconUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettingsInternal)Setting).BotIconUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettingsInternal)Setting).BotIconUrl = value ?? null; } + public string SettingBotIconUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettingsInternal)Setting).BotIconUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettingsInternal)Setting).BotIconUrl = value ?? null; } /// The bot id [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string SettingBotId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettingsInternal)Setting).BotId; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettingsInternal)Setting).BotId = value ?? null; } + public string SettingBotId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettingsInternal)Setting).BotId; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettingsInternal)Setting).BotId = value ?? null; } /// The channel display name [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string SettingChannelDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettingsInternal)Setting).ChannelDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettingsInternal)Setting).ChannelDisplayName = value ?? null; } + public string SettingChannelDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettingsInternal)Setting).ChannelDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettingsInternal)Setting).ChannelDisplayName = value ?? null; } /// The channel id [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string SettingChannelId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettingsInternal)Setting).ChannelId; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettingsInternal)Setting).ChannelId = value ?? null; } + public string SettingChannelId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettingsInternal)Setting).ChannelId; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettingsInternal)Setting).ChannelId = value ?? null; } /// /// Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. /// [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public bool? SettingDisableLocalAuth { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettingsInternal)Setting).DisableLocalAuth; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettingsInternal)Setting).DisableLocalAuth = value ?? default(bool); } + public bool? SettingDisableLocalAuth { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettingsInternal)Setting).DisableLocalAuth; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettingsInternal)Setting).DisableLocalAuth = value ?? default(bool); } /// The extensionKey1 [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string SettingExtensionKey1 { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettingsInternal)Setting).ExtensionKey1; } + public string SettingExtensionKey1 { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettingsInternal)Setting).ExtensionKey1; } /// The extensionKey2 [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string SettingExtensionKey2 { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettingsInternal)Setting).ExtensionKey2; } + public string SettingExtensionKey2 { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettingsInternal)Setting).ExtensionKey2; } /// Whether this channel is enabled for the bot [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public bool? SettingIsEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettingsInternal)Setting).IsEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettingsInternal)Setting).IsEnabled = value ?? default(bool); } + public bool? SettingIsEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettingsInternal)Setting).IsEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettingsInternal)Setting).IsEnabled = value ?? default(bool); } /// The list of sites [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISite[] SettingSite { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettingsInternal)Setting).Site; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettingsInternal)Setting).Site = value ?? null /* arrayOf */; } + public System.Collections.Generic.List SettingSite { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettingsInternal)Setting).Site; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettingsInternal)Setting).Site = value ?? null /* arrayOf */; } /// Gets or sets the SKU of the resource. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISku Sku { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__botChannel).Sku; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__botChannel).Sku = value ?? null /* model class */; } + internal Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISku Sku { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__botChannel).Sku; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__botChannel).Sku = value ?? null /* model class */; } /// The sku name [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName? SkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__botChannel).SkuName; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__botChannel).SkuName = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName)""); } + public string SkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__botChannel).SkuName; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__botChannel).SkuName = value ?? null; } /// Gets the sku tier. This is based on the SKU name. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuTier? SkuTier { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__botChannel).SkuTier; } + public string SkuTier { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__botChannel).SkuTier; } /// Contains resource tags defined as key/value pairs. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__botChannel).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__botChannel).Tag = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__botChannel).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__botChannel).Tag = value ?? null /* model class */; } /// Specifies the type of the resource. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__botChannel).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__botChannel).Type; } /// Entity zones [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string[] Zone { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)__botChannel).Zone; } + public System.Collections.Generic.List Zone { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)__botChannel).Zone; } /// Creates an new instance. public ListChannelWithKeysResponse() @@ -226,12 +235,15 @@ public ListChannelWithKeysResponse() /// The ARM channel of list channel with keys operation response. public partial interface IListChannelWithKeysResponse : Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannel + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannel { /// Changed time of the resource [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Changed time of the resource", SerializedName = @"changedTime", PossibleTypes = new [] { typeof(string) })] @@ -240,6 +252,9 @@ public partial interface IListChannelWithKeysResponse : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Entity tag of the resource", SerializedName = @"entityTag", PossibleTypes = new [] { typeof(string) })] @@ -248,6 +263,9 @@ public partial interface IListChannelWithKeysResponse : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Provisioning state of the resource", SerializedName = @"provisioningState", PossibleTypes = new [] { typeof(string) })] @@ -256,6 +274,9 @@ public partial interface IListChannelWithKeysResponse : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The channel name", SerializedName = @"channelName", PossibleTypes = new [] { typeof(string) })] @@ -264,6 +285,9 @@ public partial interface IListChannelWithKeysResponse : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Entity Tag of the resource", SerializedName = @"etag", PossibleTypes = new [] { typeof(string) })] @@ -272,6 +296,9 @@ public partial interface IListChannelWithKeysResponse : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Specifies the location of the resource.", SerializedName = @"location", PossibleTypes = new [] { typeof(string) })] @@ -280,6 +307,9 @@ public partial interface IListChannelWithKeysResponse : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Provisioning state of the resource", SerializedName = @"provisioningState", PossibleTypes = new [] { typeof(string) })] @@ -288,6 +318,9 @@ public partial interface IListChannelWithKeysResponse : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The bot icon url", SerializedName = @"botIconUrl", PossibleTypes = new [] { typeof(string) })] @@ -296,6 +329,9 @@ public partial interface IListChannelWithKeysResponse : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The bot id", SerializedName = @"botId", PossibleTypes = new [] { typeof(string) })] @@ -304,6 +340,9 @@ public partial interface IListChannelWithKeysResponse : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The channel display name", SerializedName = @"channelDisplayName", PossibleTypes = new [] { typeof(string) })] @@ -312,6 +351,9 @@ public partial interface IListChannelWithKeysResponse : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The channel id", SerializedName = @"channelId", PossibleTypes = new [] { typeof(string) })] @@ -322,6 +364,9 @@ public partial interface IListChannelWithKeysResponse : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication.", SerializedName = @"disableLocalAuth", PossibleTypes = new [] { typeof(bool) })] @@ -330,6 +375,9 @@ public partial interface IListChannelWithKeysResponse : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The extensionKey1", SerializedName = @"extensionKey1", PossibleTypes = new [] { typeof(string) })] @@ -338,6 +386,9 @@ public partial interface IListChannelWithKeysResponse : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The extensionKey2", SerializedName = @"extensionKey2", PossibleTypes = new [] { typeof(string) })] @@ -346,6 +397,9 @@ public partial interface IListChannelWithKeysResponse : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Whether this channel is enabled for the bot", SerializedName = @"isEnabled", PossibleTypes = new [] { typeof(bool) })] @@ -354,15 +408,18 @@ public partial interface IListChannelWithKeysResponse : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of sites", SerializedName = @"sites", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISite) })] - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISite[] SettingSite { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISite) })] + System.Collections.Generic.List SettingSite { get; set; } } /// The ARM channel of list channel with keys operation response. internal partial interface IListChannelWithKeysResponseInternal : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannelInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannelInternal { /// Changed time of the resource string ChangedTime { get; set; } @@ -371,7 +428,7 @@ internal partial interface IListChannelWithKeysResponseInternal : /// Provisioning state of the resource string ProvisioningState { get; set; } /// The set of properties specific to bot channel resource - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannel Resource { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannel Resource { get; set; } /// The channel name string ResourceChannelName { get; set; } /// Entity Tag of the resource @@ -381,7 +438,7 @@ internal partial interface IListChannelWithKeysResponseInternal : /// Provisioning state of the resource string ResourceProvisioningState { get; set; } /// Channel settings - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelSettings Setting { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelSettings Setting { get; set; } /// The bot icon url string SettingBotIconUrl { get; set; } /// The bot id @@ -401,7 +458,7 @@ internal partial interface IListChannelWithKeysResponseInternal : /// Whether this channel is enabled for the bot bool? SettingIsEnabled { get; set; } /// The list of sites - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISite[] SettingSite { get; set; } + System.Collections.Generic.List SettingSite { get; set; } } } \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ListChannelWithKeysResponse.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/ListChannelWithKeysResponse.json.cs similarity index 92% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ListChannelWithKeysResponse.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/ListChannelWithKeysResponse.json.cs index 7e99bb323d9a..23e65378a174 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ListChannelWithKeysResponse.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/ListChannelWithKeysResponse.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ListChannelWithKeysResponse partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponse. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponse. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponse. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponse. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IListChannelWithKeysResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IListChannelWithKeysResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new ListChannelWithKeysResponse(json) : null; } @@ -77,12 +77,12 @@ internal ListChannelWithKeysResponse(Microsoft.Azure.PowerShell.Cmdlets.BotServi { return; } - __botChannel = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.BotChannel(json); - {_resource = If( json?.PropertyT("resource"), out var __jsonResource) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Channel.FromJson(__jsonResource) : Resource;} - {_setting = If( json?.PropertyT("setting"), out var __jsonSetting) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ChannelSettings.FromJson(__jsonSetting) : Setting;} - {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} - {_entityTag = If( json?.PropertyT("entityTag"), out var __jsonEntityTag) ? (string)__jsonEntityTag : (string)EntityTag;} - {_changedTime = If( json?.PropertyT("changedTime"), out var __jsonChangedTime) ? (string)__jsonChangedTime : (string)ChangedTime;} + __botChannel = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.BotChannel(json); + {_resource = If( json?.PropertyT("resource"), out var __jsonResource) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Channel.FromJson(__jsonResource) : _resource;} + {_setting = If( json?.PropertyT("setting"), out var __jsonSetting) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ChannelSettings.FromJson(__jsonSetting) : _setting;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} + {_entityTag = If( json?.PropertyT("entityTag"), out var __jsonEntityTag) ? (string)__jsonEntityTag : (string)_entityTag;} + {_changedTime = If( json?.PropertyT("changedTime"), out var __jsonChangedTime) ? (string)__jsonChangedTime : (string)_changedTime;} AfterFromJson(json); } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/MSTeamsChannel.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/MSTeamsChannel.PowerShell.cs similarity index 56% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/MSTeamsChannel.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/MSTeamsChannel.PowerShell.cs index 1e23ce92994d..885cc7667a72 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/MSTeamsChannel.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/MSTeamsChannel.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class MSTeamsChannel 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.BotService.Models.Api20220615Preview.IMSTeamsChannel DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannel DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new MSTeamsChannel(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.BotService.Models.Api20220615Preview.IMSTeamsChannel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new MSTeamsChannel(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Pr /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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. @@ -103,53 +111,53 @@ internal MSTeamsChannel(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.MSTeamsChannelPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.MSTeamsChannelPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Etag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Etag, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Etag, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).ProvisioningState, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("EnableCalling")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelInternal)this).EnableCalling = (bool?) content.GetValueForProperty("EnableCalling",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelInternal)this).EnableCalling, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelInternal)this).EnableCalling = (bool?) content.GetValueForProperty("EnableCalling",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelInternal)this).EnableCalling, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("CallingWebhook")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelInternal)this).CallingWebhook = (string) content.GetValueForProperty("CallingWebhook",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelInternal)this).CallingWebhook, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelInternal)this).CallingWebhook = (string) content.GetValueForProperty("CallingWebhook",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelInternal)this).CallingWebhook, global::System.Convert.ToString); } if (content.Contains("IsEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelInternal)this).IsEnabled = (bool?) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IncomingCallRoute")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelInternal)this).IncomingCallRoute = (string) content.GetValueForProperty("IncomingCallRoute",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelInternal)this).IncomingCallRoute, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelInternal)this).IncomingCallRoute = (string) content.GetValueForProperty("IncomingCallRoute",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelInternal)this).IncomingCallRoute, global::System.Convert.ToString); } if (content.Contains("DeploymentEnvironment")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelInternal)this).DeploymentEnvironment = (string) content.GetValueForProperty("DeploymentEnvironment",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelInternal)this).DeploymentEnvironment, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelInternal)this).DeploymentEnvironment = (string) content.GetValueForProperty("DeploymentEnvironment",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelInternal)this).DeploymentEnvironment, global::System.Convert.ToString); } if (content.Contains("AcceptedTerm")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelInternal)this).AcceptedTerm = (bool?) content.GetValueForProperty("AcceptedTerm",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelInternal)this).AcceptedTerm, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelInternal)this).AcceptedTerm = (bool?) content.GetValueForProperty("AcceptedTerm",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelInternal)this).AcceptedTerm, (__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. @@ -164,47 +172,47 @@ internal MSTeamsChannel(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.MSTeamsChannelPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.MSTeamsChannelPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Etag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Etag, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Etag, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).ProvisioningState, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("EnableCalling")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelInternal)this).EnableCalling = (bool?) content.GetValueForProperty("EnableCalling",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelInternal)this).EnableCalling, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelInternal)this).EnableCalling = (bool?) content.GetValueForProperty("EnableCalling",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelInternal)this).EnableCalling, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("CallingWebhook")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelInternal)this).CallingWebhook = (string) content.GetValueForProperty("CallingWebhook",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelInternal)this).CallingWebhook, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelInternal)this).CallingWebhook = (string) content.GetValueForProperty("CallingWebhook",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelInternal)this).CallingWebhook, global::System.Convert.ToString); } if (content.Contains("IsEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelInternal)this).IsEnabled = (bool?) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IncomingCallRoute")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelInternal)this).IncomingCallRoute = (string) content.GetValueForProperty("IncomingCallRoute",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelInternal)this).IncomingCallRoute, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelInternal)this).IncomingCallRoute = (string) content.GetValueForProperty("IncomingCallRoute",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelInternal)this).IncomingCallRoute, global::System.Convert.ToString); } if (content.Contains("DeploymentEnvironment")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelInternal)this).DeploymentEnvironment = (string) content.GetValueForProperty("DeploymentEnvironment",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelInternal)this).DeploymentEnvironment, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelInternal)this).DeploymentEnvironment = (string) content.GetValueForProperty("DeploymentEnvironment",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelInternal)this).DeploymentEnvironment, global::System.Convert.ToString); } if (content.Contains("AcceptedTerm")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelInternal)this).AcceptedTerm = (bool?) content.GetValueForProperty("AcceptedTerm",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelInternal)this).AcceptedTerm, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelInternal)this).AcceptedTerm = (bool?) content.GetValueForProperty("AcceptedTerm",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelInternal)this).AcceptedTerm, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializePSObject(content); } @@ -213,6 +221,18 @@ internal MSTeamsChannel(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.BotService.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(); + } } /// Microsoft Teams channel definition [System.ComponentModel.TypeConverter(typeof(MSTeamsChannelTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/MSTeamsChannel.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/MSTeamsChannel.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/MSTeamsChannel.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/MSTeamsChannel.TypeConverter.cs index 853d808a9a89..3af3dd7c8c7e 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/MSTeamsChannel.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/MSTeamsChannel.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IMSTeamsChannel ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannel ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannel).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannel).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/MSTeamsChannel.cs b/generated/BotService/BotService.Autorest/generated/api/Models/MSTeamsChannel.cs similarity index 66% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/MSTeamsChannel.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/MSTeamsChannel.cs index 5d89ebade6fa..48452e1d275a 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/MSTeamsChannel.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/MSTeamsChannel.cs @@ -3,79 +3,79 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// Microsoft Teams channel definition public partial class MSTeamsChannel : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannel, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelInternal, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannel, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelInternal, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannel __channel = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Channel(); + private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannel __channel = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Channel(); /// Whether this channel accepted terms [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public bool? AcceptedTerm { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelPropertiesInternal)Property).AcceptedTerm; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelPropertiesInternal)Property).AcceptedTerm = value ?? default(bool); } + public bool? AcceptedTerm { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelPropertiesInternal)Property).AcceptedTerm; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelPropertiesInternal)Property).AcceptedTerm = value ?? default(bool); } /// Webhook for Microsoft Teams channel calls [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string CallingWebhook { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelPropertiesInternal)Property).CallingWebhook; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelPropertiesInternal)Property).CallingWebhook = value ?? null; } + public string CallingWebhook { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelPropertiesInternal)Property).CallingWebhook; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelPropertiesInternal)Property).CallingWebhook = value ?? null; } /// Deployment environment for Microsoft Teams channel calls [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string DeploymentEnvironment { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelPropertiesInternal)Property).DeploymentEnvironment; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelPropertiesInternal)Property).DeploymentEnvironment = value ?? null; } + public string DeploymentEnvironment { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelPropertiesInternal)Property).DeploymentEnvironment; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelPropertiesInternal)Property).DeploymentEnvironment = value ?? null; } /// Enable calling for Microsoft Teams channel [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public bool? EnableCalling { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelPropertiesInternal)Property).EnableCalling; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelPropertiesInternal)Property).EnableCalling = value ?? default(bool); } + public bool? EnableCalling { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelPropertiesInternal)Property).EnableCalling; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelPropertiesInternal)Property).EnableCalling = value ?? default(bool); } /// Entity Tag of the resource [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Etag = value ?? null; } + public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Etag = value ?? null; } /// Webhook for Microsoft Teams channel calls [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string IncomingCallRoute { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelPropertiesInternal)Property).IncomingCallRoute; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelPropertiesInternal)Property).IncomingCallRoute = value ?? null; } + public string IncomingCallRoute { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelPropertiesInternal)Property).IncomingCallRoute; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelPropertiesInternal)Property).IncomingCallRoute = value ?? null; } /// Whether this channel is enabled for the bot [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public bool? IsEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelPropertiesInternal)Property).IsEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelPropertiesInternal)Property).IsEnabled = value ?? default(bool); } + public bool? IsEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelPropertiesInternal)Property).IsEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelPropertiesInternal)Property).IsEnabled = value ?? default(bool); } /// Specifies the location of the resource. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Location = value ?? null; } + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Location = value ?? null; } /// Internal Acessors for ProvisioningState - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).ProvisioningState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).ProvisioningState = value; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelProperties Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.MSTeamsChannelProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelProperties Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.MSTeamsChannelProperties()); set { {_property = value;} } } /// The channel name + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Constant] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Name = value ; } + public string Name { get => "MsTeamsChannel"; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Name = "MsTeamsChannel"; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelProperties _property; /// The set of properties specific to Microsoft Teams channel resource [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.MSTeamsChannelProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.MSTeamsChannelProperties()); set => this._property = value; } /// Provisioning state of the resource [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).ProvisioningState; } + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).ProvisioningState; } /// Creates an new instance. public MSTeamsChannel() { - + this.__channel.Name = "MsTeamsChannel"; } /// Validates that this object meets the validation criteria. @@ -93,12 +93,15 @@ public MSTeamsChannel() /// Microsoft Teams channel definition public partial interface IMSTeamsChannel : Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannel + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannel { /// Whether this channel accepted terms [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Whether this channel accepted terms", SerializedName = @"acceptedTerms", PossibleTypes = new [] { typeof(bool) })] @@ -107,6 +110,9 @@ public partial interface IMSTeamsChannel : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Webhook for Microsoft Teams channel calls", SerializedName = @"callingWebhook", PossibleTypes = new [] { typeof(string) })] @@ -115,6 +121,9 @@ public partial interface IMSTeamsChannel : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Deployment environment for Microsoft Teams channel calls", SerializedName = @"deploymentEnvironment", PossibleTypes = new [] { typeof(string) })] @@ -123,6 +132,9 @@ public partial interface IMSTeamsChannel : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Enable calling for Microsoft Teams channel", SerializedName = @"enableCalling", PossibleTypes = new [] { typeof(bool) })] @@ -131,6 +143,9 @@ public partial interface IMSTeamsChannel : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Webhook for Microsoft Teams channel calls", SerializedName = @"incomingCallRoute", PossibleTypes = new [] { typeof(string) })] @@ -139,6 +154,9 @@ public partial interface IMSTeamsChannel : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Whether this channel is enabled for the bot", SerializedName = @"isEnabled", PossibleTypes = new [] { typeof(bool) })] @@ -147,7 +165,7 @@ public partial interface IMSTeamsChannel : } /// Microsoft Teams channel definition internal partial interface IMSTeamsChannelInternal : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal { /// Whether this channel accepted terms bool? AcceptedTerm { get; set; } @@ -162,7 +180,7 @@ internal partial interface IMSTeamsChannelInternal : /// Whether this channel is enabled for the bot bool? IsEnabled { get; set; } /// The set of properties specific to Microsoft Teams channel resource - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelProperties Property { get; set; } } } \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/MSTeamsChannel.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/MSTeamsChannel.json.cs similarity index 92% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/MSTeamsChannel.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/MSTeamsChannel.json.cs index 56e2d4e64fdd..b2d7169794ee 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/MSTeamsChannel.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/MSTeamsChannel.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class MSTeamsChannel partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannel. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannel. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannel. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannel. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannel FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannel FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new MSTeamsChannel(json) : null; } @@ -77,8 +77,8 @@ internal MSTeamsChannel(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Js { return; } - __channel = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Channel(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.MSTeamsChannelProperties.FromJson(__jsonProperties) : Property;} + __channel = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Channel(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.MSTeamsChannelProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/MSTeamsChannelProperties.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/MSTeamsChannelProperties.PowerShell.cs similarity index 63% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/MSTeamsChannelProperties.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/MSTeamsChannelProperties.PowerShell.cs index e27abc2cc824..b43502c554a8 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/MSTeamsChannelProperties.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/MSTeamsChannelProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class MSTeamsChannelProperties 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.BotService.Models.Api20220615Preview.IMSTeamsChannelProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new MSTeamsChannelProperties(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.BotService.Models.Api20220615Preview.IMSTeamsChannelProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new MSTeamsChannelProperties(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Pr /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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 +111,33 @@ internal MSTeamsChannelProperties(global::System.Collections.IDictionary content // actually deserialize if (content.Contains("EnableCalling")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelPropertiesInternal)this).EnableCalling = (bool?) content.GetValueForProperty("EnableCalling",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelPropertiesInternal)this).EnableCalling, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelPropertiesInternal)this).EnableCalling = (bool?) content.GetValueForProperty("EnableCalling",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelPropertiesInternal)this).EnableCalling, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("CallingWebhook")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelPropertiesInternal)this).CallingWebhook = (string) content.GetValueForProperty("CallingWebhook",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelPropertiesInternal)this).CallingWebhook, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelPropertiesInternal)this).CallingWebhook = (string) content.GetValueForProperty("CallingWebhook",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelPropertiesInternal)this).CallingWebhook, global::System.Convert.ToString); } if (content.Contains("IsEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelPropertiesInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelPropertiesInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelPropertiesInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelPropertiesInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IncomingCallRoute")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelPropertiesInternal)this).IncomingCallRoute = (string) content.GetValueForProperty("IncomingCallRoute",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelPropertiesInternal)this).IncomingCallRoute, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelPropertiesInternal)this).IncomingCallRoute = (string) content.GetValueForProperty("IncomingCallRoute",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelPropertiesInternal)this).IncomingCallRoute, global::System.Convert.ToString); } if (content.Contains("DeploymentEnvironment")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelPropertiesInternal)this).DeploymentEnvironment = (string) content.GetValueForProperty("DeploymentEnvironment",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelPropertiesInternal)this).DeploymentEnvironment, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelPropertiesInternal)this).DeploymentEnvironment = (string) content.GetValueForProperty("DeploymentEnvironment",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelPropertiesInternal)this).DeploymentEnvironment, global::System.Convert.ToString); } if (content.Contains("AcceptedTerm")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelPropertiesInternal)this).AcceptedTerm = (bool?) content.GetValueForProperty("AcceptedTerm",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelPropertiesInternal)this).AcceptedTerm, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelPropertiesInternal)this).AcceptedTerm = (bool?) content.GetValueForProperty("AcceptedTerm",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelPropertiesInternal)this).AcceptedTerm, (__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. @@ -146,27 +152,27 @@ internal MSTeamsChannelProperties(global::System.Management.Automation.PSObject // actually deserialize if (content.Contains("EnableCalling")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelPropertiesInternal)this).EnableCalling = (bool?) content.GetValueForProperty("EnableCalling",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelPropertiesInternal)this).EnableCalling, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelPropertiesInternal)this).EnableCalling = (bool?) content.GetValueForProperty("EnableCalling",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelPropertiesInternal)this).EnableCalling, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("CallingWebhook")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelPropertiesInternal)this).CallingWebhook = (string) content.GetValueForProperty("CallingWebhook",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelPropertiesInternal)this).CallingWebhook, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelPropertiesInternal)this).CallingWebhook = (string) content.GetValueForProperty("CallingWebhook",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelPropertiesInternal)this).CallingWebhook, global::System.Convert.ToString); } if (content.Contains("IsEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelPropertiesInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelPropertiesInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelPropertiesInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelPropertiesInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IncomingCallRoute")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelPropertiesInternal)this).IncomingCallRoute = (string) content.GetValueForProperty("IncomingCallRoute",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelPropertiesInternal)this).IncomingCallRoute, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelPropertiesInternal)this).IncomingCallRoute = (string) content.GetValueForProperty("IncomingCallRoute",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelPropertiesInternal)this).IncomingCallRoute, global::System.Convert.ToString); } if (content.Contains("DeploymentEnvironment")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelPropertiesInternal)this).DeploymentEnvironment = (string) content.GetValueForProperty("DeploymentEnvironment",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelPropertiesInternal)this).DeploymentEnvironment, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelPropertiesInternal)this).DeploymentEnvironment = (string) content.GetValueForProperty("DeploymentEnvironment",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelPropertiesInternal)this).DeploymentEnvironment, global::System.Convert.ToString); } if (content.Contains("AcceptedTerm")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelPropertiesInternal)this).AcceptedTerm = (bool?) content.GetValueForProperty("AcceptedTerm",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelPropertiesInternal)this).AcceptedTerm, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelPropertiesInternal)this).AcceptedTerm = (bool?) content.GetValueForProperty("AcceptedTerm",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelPropertiesInternal)this).AcceptedTerm, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializePSObject(content); } @@ -175,6 +181,18 @@ internal MSTeamsChannelProperties(global::System.Management.Automation.PSObject /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.BotService.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 parameters to provide for the Microsoft Teams channel. [System.ComponentModel.TypeConverter(typeof(MSTeamsChannelPropertiesTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/MSTeamsChannelProperties.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/MSTeamsChannelProperties.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/MSTeamsChannelProperties.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/MSTeamsChannelProperties.TypeConverter.cs index ceb665fda3cc..f5e732e10cd7 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/MSTeamsChannelProperties.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/MSTeamsChannelProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IMSTeamsChannelProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/MSTeamsChannelProperties.cs b/generated/BotService/BotService.Autorest/generated/api/Models/MSTeamsChannelProperties.cs similarity index 91% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/MSTeamsChannelProperties.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/MSTeamsChannelProperties.cs index 04342afbe006..558adb915368 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/MSTeamsChannelProperties.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/MSTeamsChannelProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// The parameters to provide for the Microsoft Teams channel. public partial class MSTeamsChannelProperties : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelProperties, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelProperties, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelPropertiesInternal { /// Backing field for property. @@ -69,6 +69,9 @@ public partial interface IMSTeamsChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Whether this channel accepted terms", SerializedName = @"acceptedTerms", PossibleTypes = new [] { typeof(bool) })] @@ -77,6 +80,9 @@ public partial interface IMSTeamsChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Webhook for Microsoft Teams channel calls", SerializedName = @"callingWebhook", PossibleTypes = new [] { typeof(string) })] @@ -85,6 +91,9 @@ public partial interface IMSTeamsChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Deployment environment for Microsoft Teams channel calls", SerializedName = @"deploymentEnvironment", PossibleTypes = new [] { typeof(string) })] @@ -93,6 +102,9 @@ public partial interface IMSTeamsChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Enable calling for Microsoft Teams channel", SerializedName = @"enableCalling", PossibleTypes = new [] { typeof(bool) })] @@ -101,6 +113,9 @@ public partial interface IMSTeamsChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Webhook for Microsoft Teams channel calls", SerializedName = @"incomingCallRoute", PossibleTypes = new [] { typeof(string) })] @@ -109,6 +124,9 @@ public partial interface IMSTeamsChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Whether this channel is enabled for the bot", SerializedName = @"isEnabled", PossibleTypes = new [] { typeof(bool) })] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/MSTeamsChannelProperties.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/MSTeamsChannelProperties.json.cs similarity index 93% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/MSTeamsChannelProperties.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/MSTeamsChannelProperties.json.cs index 7a915c291f8a..d7b577439acd 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/MSTeamsChannelProperties.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/MSTeamsChannelProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class MSTeamsChannelProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IMSTeamsChannelProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IMSTeamsChannelProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new MSTeamsChannelProperties(json) : null; } @@ -77,12 +77,12 @@ internal MSTeamsChannelProperties(Microsoft.Azure.PowerShell.Cmdlets.BotService. { return; } - {_enableCalling = If( json?.PropertyT("enableCalling"), out var __jsonEnableCalling) ? (bool?)__jsonEnableCalling : EnableCalling;} - {_callingWebhook = If( json?.PropertyT("callingWebhook"), out var __jsonCallingWebhook) ? (string)__jsonCallingWebhook : (string)CallingWebhook;} - {_isEnabled = If( json?.PropertyT("isEnabled"), out var __jsonIsEnabled) ? (bool)__jsonIsEnabled : IsEnabled;} - {_incomingCallRoute = If( json?.PropertyT("incomingCallRoute"), out var __jsonIncomingCallRoute) ? (string)__jsonIncomingCallRoute : (string)IncomingCallRoute;} - {_deploymentEnvironment = If( json?.PropertyT("deploymentEnvironment"), out var __jsonDeploymentEnvironment) ? (string)__jsonDeploymentEnvironment : (string)DeploymentEnvironment;} - {_acceptedTerm = If( json?.PropertyT("acceptedTerms"), out var __jsonAcceptedTerms) ? (bool?)__jsonAcceptedTerms : AcceptedTerm;} + {_enableCalling = If( json?.PropertyT("enableCalling"), out var __jsonEnableCalling) ? (bool?)__jsonEnableCalling : _enableCalling;} + {_callingWebhook = If( json?.PropertyT("callingWebhook"), out var __jsonCallingWebhook) ? (string)__jsonCallingWebhook : (string)_callingWebhook;} + {_isEnabled = If( json?.PropertyT("isEnabled"), out var __jsonIsEnabled) ? (bool)__jsonIsEnabled : _isEnabled;} + {_incomingCallRoute = If( json?.PropertyT("incomingCallRoute"), out var __jsonIncomingCallRoute) ? (string)__jsonIncomingCallRoute : (string)_incomingCallRoute;} + {_deploymentEnvironment = If( json?.PropertyT("deploymentEnvironment"), out var __jsonDeploymentEnvironment) ? (string)__jsonDeploymentEnvironment : (string)_deploymentEnvironment;} + {_acceptedTerm = If( json?.PropertyT("acceptedTerms"), out var __jsonAcceptedTerms) ? (bool?)__jsonAcceptedTerms : _acceptedTerm;} AfterFromJson(json); } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/OperationDisplayInfo.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/OperationDisplayInfo.PowerShell.cs similarity index 69% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/OperationDisplayInfo.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/OperationDisplayInfo.PowerShell.cs index 441777fd4f3b..8f1f0f41d4de 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/OperationDisplayInfo.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/OperationDisplayInfo.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class OperationDisplayInfo 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.BotService.Models.Api20220615Preview.IOperationDisplayInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationDisplayInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new OperationDisplayInfo(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.BotService.Models.Api20220615Preview.IOperationDisplayInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationDisplayInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new OperationDisplayInfo(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Pr /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationDisplayInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationDisplayInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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 OperationDisplayInfo(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationDisplayInfoInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationDisplayInfoInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationDisplayInfoInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationDisplayInfoInternal)this).Description, global::System.Convert.ToString); } if (content.Contains("Operation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationDisplayInfoInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationDisplayInfoInternal)this).Operation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationDisplayInfoInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationDisplayInfoInternal)this).Operation, global::System.Convert.ToString); } if (content.Contains("Provider")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationDisplayInfoInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationDisplayInfoInternal)this).Provider, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationDisplayInfoInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationDisplayInfoInternal)this).Provider, global::System.Convert.ToString); } if (content.Contains("Resource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationDisplayInfoInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationDisplayInfoInternal)this).Resource, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationDisplayInfoInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationDisplayInfoInternal)this).Resource, 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 OperationDisplayInfo(global::System.Management.Automation.PSObject cont // actually deserialize if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationDisplayInfoInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationDisplayInfoInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationDisplayInfoInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationDisplayInfoInternal)this).Description, global::System.Convert.ToString); } if (content.Contains("Operation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationDisplayInfoInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationDisplayInfoInternal)this).Operation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationDisplayInfoInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationDisplayInfoInternal)this).Operation, global::System.Convert.ToString); } if (content.Contains("Provider")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationDisplayInfoInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationDisplayInfoInternal)this).Provider, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationDisplayInfoInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationDisplayInfoInternal)this).Provider, global::System.Convert.ToString); } if (content.Contains("Resource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationDisplayInfoInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationDisplayInfoInternal)this).Resource, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationDisplayInfoInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationDisplayInfoInternal)this).Resource, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -159,6 +165,18 @@ internal OperationDisplayInfo(global::System.Management.Automation.PSObject cont /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.BotService.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 operation supported by Bot Service Management. [System.ComponentModel.TypeConverter(typeof(OperationDisplayInfoTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/OperationDisplayInfo.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/OperationDisplayInfo.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/OperationDisplayInfo.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/OperationDisplayInfo.TypeConverter.cs index eee0394e01e0..c8c671daeb64 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/OperationDisplayInfo.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/OperationDisplayInfo.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IOperationDisplayInfo ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationDisplayInfo ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationDisplayInfo).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationDisplayInfo).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/OperationDisplayInfo.cs b/generated/BotService/BotService.Autorest/generated/api/Models/OperationDisplayInfo.cs similarity index 90% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/OperationDisplayInfo.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/OperationDisplayInfo.cs index 34a970b002e4..50ae2e22f9d8 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/OperationDisplayInfo.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/OperationDisplayInfo.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// The operation supported by Bot Service Management. public partial class OperationDisplayInfo : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationDisplayInfo, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationDisplayInfoInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationDisplayInfo, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationDisplayInfoInternal { /// Backing field for property. @@ -55,6 +55,9 @@ public partial interface IOperationDisplayInfo : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The description of the operation.", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -63,6 +66,9 @@ public partial interface IOperationDisplayInfo : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The action that users can perform, based on their permission level.", SerializedName = @"operation", PossibleTypes = new [] { typeof(string) })] @@ -71,6 +77,9 @@ public partial interface IOperationDisplayInfo : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Service provider: Microsoft Bot Service.", SerializedName = @"provider", PossibleTypes = new [] { typeof(string) })] @@ -79,6 +88,9 @@ public partial interface IOperationDisplayInfo : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Resource on which the operation is performed.", SerializedName = @"resource", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/OperationDisplayInfo.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/OperationDisplayInfo.json.cs similarity index 93% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/OperationDisplayInfo.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/OperationDisplayInfo.json.cs index 582ed3c58940..8b2e114913aa 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/OperationDisplayInfo.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/OperationDisplayInfo.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class OperationDisplayInfo partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationDisplayInfo. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationDisplayInfo. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationDisplayInfo. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationDisplayInfo. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationDisplayInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationDisplayInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new OperationDisplayInfo(json) : null; } @@ -77,10 +77,10 @@ internal OperationDisplayInfo(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runt { return; } - {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} - {_operation = If( json?.PropertyT("operation"), out var __jsonOperation) ? (string)__jsonOperation : (string)Operation;} - {_provider = If( json?.PropertyT("provider"), out var __jsonProvider) ? (string)__jsonProvider : (string)Provider;} - {_resource = If( json?.PropertyT("resource"), out var __jsonResource) ? (string)__jsonResource : (string)Resource;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)_description;} + {_operation = If( json?.PropertyT("operation"), out var __jsonOperation) ? (string)__jsonOperation : (string)_operation;} + {_provider = If( json?.PropertyT("provider"), out var __jsonProvider) ? (string)__jsonProvider : (string)_provider;} + {_resource = If( json?.PropertyT("resource"), out var __jsonResource) ? (string)__jsonResource : (string)_resource;} AfterFromJson(json); } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/OperationEntity.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/OperationEntity.PowerShell.cs similarity index 60% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/OperationEntity.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/OperationEntity.PowerShell.cs index 446ea2f38e68..c8e7cd0feec5 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/OperationEntity.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/OperationEntity.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class OperationEntity 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.BotService.Models.Api20220615Preview.IOperationEntity DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntity DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new OperationEntity(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.BotService.Models.Api20220615Preview.IOperationEntity DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntity DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new OperationEntity(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Pr /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntity FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntity FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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. @@ -103,41 +111,41 @@ internal OperationEntity(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Display")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntityInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationDisplayInfo) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntityInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.OperationDisplayInfoTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntityInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationDisplayInfo) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntityInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.OperationDisplayInfoTypeConverter.ConvertFrom); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntityInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntityInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntityInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntityInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Origin")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntityInternal)this).Origin = (string) content.GetValueForProperty("Origin",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntityInternal)this).Origin, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntityInternal)this).Origin = (string) content.GetValueForProperty("Origin",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntityInternal)this).Origin, global::System.Convert.ToString); } if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntityInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAny) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntityInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.AnyTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntityInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAny) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntityInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.AnyTypeConverter.ConvertFrom); } if (content.Contains("DisplayDescription")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntityInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntityInternal)this).DisplayDescription, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntityInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntityInternal)this).DisplayDescription, global::System.Convert.ToString); } if (content.Contains("DisplayOperation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntityInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntityInternal)this).DisplayOperation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntityInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntityInternal)this).DisplayOperation, global::System.Convert.ToString); } if (content.Contains("DisplayProvider")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntityInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntityInternal)this).DisplayProvider, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntityInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntityInternal)this).DisplayProvider, global::System.Convert.ToString); } if (content.Contains("DisplayResource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntityInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntityInternal)this).DisplayResource, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntityInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntityInternal)this).DisplayResource, 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. @@ -152,35 +160,35 @@ internal OperationEntity(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Display")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntityInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationDisplayInfo) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntityInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.OperationDisplayInfoTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntityInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationDisplayInfo) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntityInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.OperationDisplayInfoTypeConverter.ConvertFrom); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntityInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntityInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntityInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntityInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Origin")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntityInternal)this).Origin = (string) content.GetValueForProperty("Origin",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntityInternal)this).Origin, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntityInternal)this).Origin = (string) content.GetValueForProperty("Origin",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntityInternal)this).Origin, global::System.Convert.ToString); } if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntityInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAny) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntityInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.AnyTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntityInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAny) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntityInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.AnyTypeConverter.ConvertFrom); } if (content.Contains("DisplayDescription")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntityInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntityInternal)this).DisplayDescription, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntityInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntityInternal)this).DisplayDescription, global::System.Convert.ToString); } if (content.Contains("DisplayOperation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntityInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntityInternal)this).DisplayOperation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntityInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntityInternal)this).DisplayOperation, global::System.Convert.ToString); } if (content.Contains("DisplayProvider")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntityInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntityInternal)this).DisplayProvider, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntityInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntityInternal)this).DisplayProvider, global::System.Convert.ToString); } if (content.Contains("DisplayResource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntityInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntityInternal)this).DisplayResource, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntityInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntityInternal)this).DisplayResource, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -189,6 +197,18 @@ internal OperationEntity(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.BotService.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 operations supported by Bot Service Management. [System.ComponentModel.TypeConverter(typeof(OperationEntityTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/OperationEntity.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/OperationEntity.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/OperationEntity.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/OperationEntity.TypeConverter.cs index d3d116cbec38..d03128b9735a 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/OperationEntity.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/OperationEntity.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IOperationEntity ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntity ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntity).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntity).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/OperationEntity.cs b/generated/BotService/BotService.Autorest/generated/api/Models/OperationEntity.cs similarity index 77% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/OperationEntity.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/OperationEntity.cs index 7707383de832..71a9a94ca93a 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/OperationEntity.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/OperationEntity.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// The operations supported by Bot Service Management. public partial class OperationEntity : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntity, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntityInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntity, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntityInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationDisplayInfo _display; + private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationDisplayInfo _display; /// The operation supported by Bot Service Management. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationDisplayInfo Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.OperationDisplayInfo()); set => this._display = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationDisplayInfo Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.OperationDisplayInfo()); set => this._display = value; } /// The description of the operation. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string DisplayDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationDisplayInfoInternal)Display).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationDisplayInfoInternal)Display).Description = value ?? null; } + public string DisplayDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationDisplayInfoInternal)Display).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationDisplayInfoInternal)Display).Description = value ?? null; } /// The action that users can perform, based on their permission level. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string DisplayOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationDisplayInfoInternal)Display).Operation; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationDisplayInfoInternal)Display).Operation = value ?? null; } + public string DisplayOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationDisplayInfoInternal)Display).Operation; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationDisplayInfoInternal)Display).Operation = value ?? null; } /// Service provider: Microsoft Bot Service. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string DisplayProvider { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationDisplayInfoInternal)Display).Provider; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationDisplayInfoInternal)Display).Provider = value ?? null; } + public string DisplayProvider { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationDisplayInfoInternal)Display).Provider; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationDisplayInfoInternal)Display).Provider = value ?? null; } /// Resource on which the operation is performed. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string DisplayResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationDisplayInfoInternal)Display).Resource; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationDisplayInfoInternal)Display).Resource = value ?? null; } + public string DisplayResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationDisplayInfoInternal)Display).Resource; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationDisplayInfoInternal)Display).Resource = value ?? null; } /// Internal Acessors for Display - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationDisplayInfo Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntityInternal.Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.OperationDisplayInfo()); set { {_display = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationDisplayInfo Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntityInternal.Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.OperationDisplayInfo()); set { {_display = value;} } } /// Backing field for property. private string _name; @@ -74,6 +74,9 @@ public partial interface IOperationEntity : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The description of the operation.", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -82,6 +85,9 @@ public partial interface IOperationEntity : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The action that users can perform, based on their permission level.", SerializedName = @"operation", PossibleTypes = new [] { typeof(string) })] @@ -90,6 +96,9 @@ public partial interface IOperationEntity : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Service provider: Microsoft Bot Service.", SerializedName = @"provider", PossibleTypes = new [] { typeof(string) })] @@ -98,6 +107,9 @@ public partial interface IOperationEntity : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Resource on which the operation is performed.", SerializedName = @"resource", PossibleTypes = new [] { typeof(string) })] @@ -106,6 +118,9 @@ public partial interface IOperationEntity : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Operation name: {provider}/{resource}/{operation}.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -114,6 +129,9 @@ public partial interface IOperationEntity : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The origin of the operation.", SerializedName = @"origin", PossibleTypes = new [] { typeof(string) })] @@ -122,6 +140,9 @@ public partial interface IOperationEntity : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Additional properties.", SerializedName = @"properties", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IAny) })] @@ -133,7 +154,7 @@ internal partial interface IOperationEntityInternal { /// The operation supported by Bot Service Management. - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationDisplayInfo Display { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationDisplayInfo Display { get; set; } /// The description of the operation. string DisplayDescription { get; set; } /// The action that users can perform, based on their permission level. diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/OperationEntity.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/OperationEntity.json.cs similarity index 92% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/OperationEntity.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/OperationEntity.json.cs index 895f9254240d..5fbfae3253b3 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/OperationEntity.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/OperationEntity.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class OperationEntity partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntity. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntity. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntity. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntity. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntity FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntity FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new OperationEntity(json) : null; } @@ -77,10 +77,10 @@ internal OperationEntity(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.J { return; } - {_display = If( json?.PropertyT("display"), out var __jsonDisplay) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.OperationDisplayInfo.FromJson(__jsonDisplay) : Display;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_origin = If( json?.PropertyT("origin"), out var __jsonOrigin) ? (string)__jsonOrigin : (string)Origin;} - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Any.FromJson(__jsonProperties) : Property;} + {_display = If( json?.PropertyT("display"), out var __jsonDisplay) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.OperationDisplayInfo.FromJson(__jsonDisplay) : _display;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_origin = If( json?.PropertyT("origin"), out var __jsonOrigin) ? (string)__jsonOrigin : (string)_origin;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Any.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/OperationEntityListResult.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/OperationEntityListResult.PowerShell.cs similarity index 69% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/OperationEntityListResult.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/OperationEntityListResult.PowerShell.cs index ba64cf76580f..66951a284593 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/OperationEntityListResult.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/OperationEntityListResult.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class OperationEntityListResult 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.BotService.Models.Api20220615Preview.IOperationEntityListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntityListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new OperationEntityListResult(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.BotService.Models.Api20220615Preview.IOperationEntityListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntityListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new OperationEntityListResult(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Pr /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntityListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntityListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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 +111,17 @@ internal OperationEntityListResult(global::System.Collections.IDictionary conten // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntityListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntityListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntityListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntityListResultInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntityListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntity[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntityListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.OperationEntityTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntityListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntityListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.OperationEntityTypeConverter.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,11 +136,11 @@ internal OperationEntityListResult(global::System.Management.Automation.PSObject // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntityListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntityListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntityListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntityListResultInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntityListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntity[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntityListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.OperationEntityTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntityListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntityListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.OperationEntityTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } @@ -143,6 +149,18 @@ internal OperationEntityListResult(global::System.Management.Automation.PSObject /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.BotService.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 list of bot service operation response. [System.ComponentModel.TypeConverter(typeof(OperationEntityListResultTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/OperationEntityListResult.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/OperationEntityListResult.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/OperationEntityListResult.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/OperationEntityListResult.TypeConverter.cs index 479b87682ca0..9d2dd1974def 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/OperationEntityListResult.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/OperationEntityListResult.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IOperationEntityListResult ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntityListResult ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntityListResult).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntityListResult).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/OperationEntityListResult.cs b/generated/BotService/BotService.Autorest/generated/api/Models/OperationEntityListResult.cs similarity index 72% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/OperationEntityListResult.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/OperationEntityListResult.cs index 3bc101b44b63..8dbd44b8e2db 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/OperationEntityListResult.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/OperationEntityListResult.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// The list of bot service operation response. public partial class OperationEntityListResult : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntityListResult, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntityListResultInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntityListResult, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntityListResultInternal { /// Backing field for property. @@ -21,11 +21,11 @@ public partial class OperationEntityListResult : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntity[] _value; + private System.Collections.Generic.List _value; /// The list of operations. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntity[] 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 OperationEntityListResult() @@ -41,6 +41,9 @@ public partial interface IOperationEntityListResult : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The link used to get the next page of operations.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -49,10 +52,13 @@ public partial interface IOperationEntityListResult : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of operations.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntity) })] - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntity[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntity) })] + System.Collections.Generic.List Value { get; set; } } /// The list of bot service operation response. @@ -62,7 +68,7 @@ internal partial interface IOperationEntityListResultInternal /// The link used to get the next page of operations. string NextLink { get; set; } /// The list of operations. - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntity[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/OperationEntityListResult.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/OperationEntityListResult.json.cs similarity index 89% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/OperationEntityListResult.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/OperationEntityListResult.json.cs index 4dc405ef0dd1..628b37a2f113 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/OperationEntityListResult.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/OperationEntityListResult.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class OperationEntityListResult partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntityListResult. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntityListResult. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntityListResult. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntityListResult. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntityListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntityListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new OperationEntityListResult(json) : null; } @@ -77,8 +77,8 @@ internal OperationEntityListResult(Microsoft.Azure.PowerShell.Cmdlets.BotService { return; } - {_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.BotService.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.BotService.Models.Api20220615Preview.IOperationEntity) (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.OperationEntity.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.BotService.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.BotService.Models.IOperationEntity) (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.OperationEntity.FromJson(__u) )) ))() : null : _value;} AfterFromJson(json); } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/OperationResultsDescription.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/OperationResultsDescription.PowerShell.cs similarity index 67% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/OperationResultsDescription.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/OperationResultsDescription.PowerShell.cs index 972dc0e80982..e1cbb5e5b907 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/OperationResultsDescription.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/OperationResultsDescription.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class OperationResultsDescription 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.BotService.Models.Api20220615Preview.IOperationResultsDescription DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationResultsDescription DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new OperationResultsDescription(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.BotService.Models.Api20220615Preview.IOperationResultsDescription DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationResultsDescription DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new OperationResultsDescription(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Pr /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationResultsDescription FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationResultsDescription FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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 OperationResultsDescription(global::System.Collections.IDictionary cont // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationResultsDescriptionInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationResultsDescriptionInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationResultsDescriptionInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationResultsDescriptionInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationResultsDescriptionInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationResultsDescriptionInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationResultsDescriptionInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationResultsDescriptionInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationResultsDescriptionInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.OperationResultStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationResultsDescriptionInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.OperationResultStatus.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationResultsDescriptionInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationResultsDescriptionInternal)this).Status, global::System.Convert.ToString); } if (content.Contains("StartTime")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationResultsDescriptionInternal)this).StartTime = (global::System.DateTime?) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationResultsDescriptionInternal)this).StartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationResultsDescriptionInternal)this).StartTime = (global::System.DateTime?) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationResultsDescriptionInternal)this).StartTime, (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. @@ -138,19 +144,19 @@ internal OperationResultsDescription(global::System.Management.Automation.PSObje // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationResultsDescriptionInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationResultsDescriptionInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationResultsDescriptionInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationResultsDescriptionInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationResultsDescriptionInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationResultsDescriptionInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationResultsDescriptionInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationResultsDescriptionInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationResultsDescriptionInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.OperationResultStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationResultsDescriptionInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.OperationResultStatus.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationResultsDescriptionInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationResultsDescriptionInternal)this).Status, global::System.Convert.ToString); } if (content.Contains("StartTime")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationResultsDescriptionInternal)this).StartTime = (global::System.DateTime?) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationResultsDescriptionInternal)this).StartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationResultsDescriptionInternal)this).StartTime = (global::System.DateTime?) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationResultsDescriptionInternal)this).StartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } AfterDeserializePSObject(content); } @@ -159,6 +165,18 @@ internal OperationResultsDescription(global::System.Management.Automation.PSObje /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.BotService.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 properties indicating the operation result of an operation on a service. [System.ComponentModel.TypeConverter(typeof(OperationResultsDescriptionTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/OperationResultsDescription.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/OperationResultsDescription.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/OperationResultsDescription.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/OperationResultsDescription.TypeConverter.cs index fcaf8acfecd2..53a7870fe65e 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/OperationResultsDescription.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/OperationResultsDescription.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IOperationResultsDescription ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationResultsDescription ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationResultsDescription).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationResultsDescription).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/OperationResultsDescription.cs b/generated/BotService/BotService.Autorest/generated/api/Models/OperationResultsDescription.cs similarity index 76% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/OperationResultsDescription.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/OperationResultsDescription.cs index d82c1aaf9c79..48dc2ff846c7 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/OperationResultsDescription.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/OperationResultsDescription.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// The properties indicating the operation result of an operation on a service. public partial class OperationResultsDescription : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationResultsDescription, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationResultsDescriptionInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationResultsDescription, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationResultsDescriptionInternal { /// Backing field for property. @@ -21,16 +21,16 @@ public partial class OperationResultsDescription : public string Id { get => this._id; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationResultsDescriptionInternal.Id { get => this._id; set { {_id = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationResultsDescriptionInternal.Id { get => this._id; set { {_id = value;} } } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationResultsDescriptionInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationResultsDescriptionInternal.Name { get => this._name; set { {_name = value;} } } /// Internal Acessors for StartTime - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationResultsDescriptionInternal.StartTime { get => this._startTime; set { {_startTime = value;} } } + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationResultsDescriptionInternal.StartTime { get => this._startTime; set { {_startTime = value;} } } /// Internal Acessors for Status - Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.OperationResultStatus? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationResultsDescriptionInternal.Status { get => this._status; set { {_status = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationResultsDescriptionInternal.Status { get => this._status; set { {_status = value;} } } /// Backing field for property. private string _name; @@ -47,11 +47,11 @@ public partial class OperationResultsDescription : public global::System.DateTime? StartTime { get => this._startTime; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.OperationResultStatus? _status; + private string _status; /// The status of the operation being performed. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.OperationResultStatus? Status { get => this._status; } + public string Status { get => this._status; } /// Creates an new instance. public OperationResultsDescription() @@ -67,6 +67,9 @@ public partial interface IOperationResultsDescription : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The ID of the operation returned.", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -75,6 +78,9 @@ public partial interface IOperationResultsDescription : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The name of the operation result.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -83,6 +89,9 @@ public partial interface IOperationResultsDescription : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The time that the operation was started.", SerializedName = @"startTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -91,10 +100,14 @@ public partial interface IOperationResultsDescription : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The status of the operation being performed.", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.OperationResultStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.OperationResultStatus? Status { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("Canceled", "Succeeded", "Failed", "Requested", "Running")] + string Status { get; } } /// The properties indicating the operation result of an operation on a service. @@ -108,7 +121,8 @@ internal partial interface IOperationResultsDescriptionInternal /// The time that the operation was started. global::System.DateTime? StartTime { get; set; } /// The status of the operation being performed. - Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.OperationResultStatus? Status { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("Canceled", "Succeeded", "Failed", "Requested", "Running")] + string Status { get; set; } } } \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/OperationResultsDescription.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/OperationResultsDescription.json.cs similarity index 90% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/OperationResultsDescription.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/OperationResultsDescription.json.cs index 727bc7a1606f..22c3e24f2907 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/OperationResultsDescription.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/OperationResultsDescription.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class OperationResultsDescription partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationResultsDescription. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationResultsDescription. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationResultsDescription. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationResultsDescription. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationResultsDescription FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationResultsDescription FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new OperationResultsDescription(json) : null; } @@ -77,10 +77,10 @@ internal OperationResultsDescription(Microsoft.Azure.PowerShell.Cmdlets.BotServi { 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;} - {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} - {_startTime = If( json?.PropertyT("startTime"), out var __jsonStartTime) ? global::System.DateTime.TryParse((string)__jsonStartTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartTimeValue) ? __jsonStartTimeValue : StartTime : StartTime;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)_status;} + {_startTime = If( json?.PropertyT("startTime"), out var __jsonStartTime) ? global::System.DateTime.TryParse((string)__jsonStartTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartTimeValue) ? __jsonStartTimeValue : _startTime : _startTime;} AfterFromJson(json); } @@ -103,19 +103,19 @@ public Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode ToJso { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._startTime ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._startTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "startTime" ,container.Add ); } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/OutlookChannel.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/OutlookChannel.PowerShell.cs similarity index 70% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/OutlookChannel.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/OutlookChannel.PowerShell.cs index 4c5af5230034..c9eda33e3d26 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/OutlookChannel.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/OutlookChannel.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class OutlookChannel 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.BotService.Models.Api20220615Preview.IOutlookChannel DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOutlookChannel DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new OutlookChannel(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.BotService.Models.Api20220615Preview.IOutlookChannel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOutlookChannel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new OutlookChannel(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Pr /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOutlookChannel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOutlookChannel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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. @@ -103,25 +111,25 @@ internal OutlookChannel(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Etag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Etag, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Etag, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).ProvisioningState, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Location, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -136,19 +144,19 @@ internal OutlookChannel(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Etag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Etag, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Etag, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).ProvisioningState, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Location, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -157,6 +165,18 @@ internal OutlookChannel(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.BotService.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(); + } } /// Outlook channel definition [System.ComponentModel.TypeConverter(typeof(OutlookChannelTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/OutlookChannel.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/OutlookChannel.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/OutlookChannel.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/OutlookChannel.TypeConverter.cs index e15868e15a27..aa503678cdf3 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/OutlookChannel.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/OutlookChannel.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IOutlookChannel ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOutlookChannel ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOutlookChannel).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOutlookChannel).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/OutlookChannel.cs b/generated/BotService/BotService.Autorest/generated/api/Models/OutlookChannel.cs similarity index 62% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/OutlookChannel.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/OutlookChannel.cs index 97de5b816e23..214a3c1f2c5f 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/OutlookChannel.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/OutlookChannel.cs @@ -3,45 +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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// Outlook channel definition public partial class OutlookChannel : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOutlookChannel, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOutlookChannelInternal, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOutlookChannel, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOutlookChannelInternal, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannel __channel = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Channel(); + private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannel __channel = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Channel(); /// Entity Tag of the resource [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Etag = value ?? null; } + public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Etag = value ?? null; } /// Specifies the location of the resource. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Location = value ?? null; } + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Location = value ?? null; } /// Internal Acessors for ProvisioningState - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).ProvisioningState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).ProvisioningState = value; } /// The channel name + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Constant] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Name = value ; } + public string Name { get => "OutlookChannel"; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Name = "OutlookChannel"; } /// Provisioning state of the resource [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).ProvisioningState; } + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).ProvisioningState; } /// Creates an new instance. public OutlookChannel() { - + this.__channel.Name = "OutlookChannel"; } /// Validates that this object meets the validation criteria. @@ -59,13 +59,13 @@ public OutlookChannel() /// Outlook channel definition public partial interface IOutlookChannel : Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannel + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannel { } /// Outlook channel definition internal partial interface IOutlookChannelInternal : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal { } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/OutlookChannel.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/OutlookChannel.json.cs similarity index 93% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/OutlookChannel.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/OutlookChannel.json.cs index 268af6b4291b..8d7b76566ffb 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/OutlookChannel.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/OutlookChannel.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class OutlookChannel partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOutlookChannel. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOutlookChannel. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOutlookChannel. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOutlookChannel. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOutlookChannel FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOutlookChannel FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new OutlookChannel(json) : null; } @@ -77,7 +77,7 @@ internal OutlookChannel(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Js { return; } - __channel = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Channel(json); + __channel = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Channel(json); AfterFromJson(json); } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateEndpoint.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateEndpoint.PowerShell.cs similarity index 77% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateEndpoint.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/PrivateEndpoint.PowerShell.cs index be753bc6f026..e7cde64e66bb 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateEndpoint.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateEndpoint.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class PrivateEndpoint 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.BotService.Models.Api20220615Preview.IPrivateEndpoint DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpoint DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new PrivateEndpoint(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpoint DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpoint DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new PrivateEndpoint(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Pr /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpoint FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpoint FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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. @@ -103,13 +111,13 @@ internal PrivateEndpoint(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointInternal)this).Id, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -124,7 +132,7 @@ internal PrivateEndpoint(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointInternal)this).Id, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -133,6 +141,18 @@ internal PrivateEndpoint(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The Private Endpoint resource. [System.ComponentModel.TypeConverter(typeof(PrivateEndpointTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateEndpoint.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateEndpoint.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateEndpoint.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/PrivateEndpoint.TypeConverter.cs index 490bea0bdb3a..c15eccc512d0 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateEndpoint.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateEndpoint.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IPrivateEndpoint ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpoint ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpoint).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpoint).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateEndpoint.cs b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateEndpoint.cs similarity index 83% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateEndpoint.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/PrivateEndpoint.cs index 228f9ac61e2a..8db56b4a5b20 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateEndpoint.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateEndpoint.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// The Private Endpoint resource. public partial class PrivateEndpoint : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpoint, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpoint, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointInternal { /// Backing field for property. @@ -21,7 +21,7 @@ public partial class PrivateEndpoint : public string Id { get => this._id; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointInternal.Id { get => this._id; set { {_id = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointInternal.Id { get => this._id; set { {_id = value;} } } /// Creates an new instance. public PrivateEndpoint() @@ -37,6 +37,9 @@ public partial interface IPrivateEndpoint : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The ARM identifier for Private Endpoint", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateEndpoint.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateEndpoint.json.cs similarity index 93% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateEndpoint.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/PrivateEndpoint.json.cs index 02a972e67b43..ac311315cce0 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateEndpoint.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateEndpoint.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class PrivateEndpoint partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpoint. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpoint. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpoint. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpoint. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpoint FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpoint FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new PrivateEndpoint(json) : null; } @@ -77,7 +77,7 @@ internal PrivateEndpoint(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.J { return; } - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} AfterFromJson(json); } @@ -100,7 +100,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode ToJso { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateEndpointConnection.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateEndpointConnection.PowerShell.cs similarity index 50% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateEndpointConnection.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/PrivateEndpointConnection.PowerShell.cs index c8afe04efa5f..8b94f9360438 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateEndpointConnection.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateEndpointConnection.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class PrivateEndpointConnection 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.BotService.Models.Api20220615Preview.IPrivateEndpointConnection DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnection DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new PrivateEndpointConnection(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.BotService.Models.Api20220615Preview.IPrivateEndpointConnection DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnection DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new PrivateEndpointConnection(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Pr /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnection FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnection FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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,53 +111,53 @@ internal PrivateEndpointConnection(global::System.Collections.IDictionary conten // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateEndpointConnectionPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.PrivateEndpointConnectionPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("PrivateEndpoint")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionInternal)this).PrivateEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpoint) content.GetValueForProperty("PrivateEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionInternal)this).PrivateEndpoint, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateEndpointTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionInternal)this).PrivateEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpoint) content.GetValueForProperty("PrivateEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionInternal)this).PrivateEndpoint, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.PrivateEndpointTypeConverter.ConvertFrom); } if (content.Contains("PrivateLinkServiceConnectionState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionState = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkServiceConnectionState) content.GetValueForProperty("PrivateLinkServiceConnectionState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionState, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateLinkServiceConnectionStateTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionState = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkServiceConnectionState) content.GetValueForProperty("PrivateLinkServiceConnectionState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionState, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.PrivateLinkServiceConnectionStateTypeConverter.ConvertFrom); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointConnectionProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointConnectionProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("PrivateEndpointId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionInternal)this).PrivateEndpointId = (string) content.GetValueForProperty("PrivateEndpointId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionInternal)this).PrivateEndpointId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionInternal)this).PrivateEndpointId = (string) content.GetValueForProperty("PrivateEndpointId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionInternal)this).PrivateEndpointId, global::System.Convert.ToString); } if (content.Contains("PrivateLinkServiceConnectionStateDescription")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateDescription = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateDescription",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateDescription, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateDescription = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateDescription",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateDescription, global::System.Convert.ToString); } if (content.Contains("PrivateLinkServiceConnectionStateActionsRequired")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateActionsRequired = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateActionsRequired",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateActionsRequired, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateActionsRequired = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateActionsRequired",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateActionsRequired, global::System.Convert.ToString); } if (content.Contains("PrivateLinkServiceConnectionStateStatus")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateStatus = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointServiceConnectionStatus?) content.GetValueForProperty("PrivateLinkServiceConnectionStateStatus",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateStatus, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointServiceConnectionStatus.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateStatus = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateStatus",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateStatus, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -166,47 +172,47 @@ internal PrivateEndpointConnection(global::System.Management.Automation.PSObject // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateEndpointConnectionPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.PrivateEndpointConnectionPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("PrivateEndpoint")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionInternal)this).PrivateEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpoint) content.GetValueForProperty("PrivateEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionInternal)this).PrivateEndpoint, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateEndpointTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionInternal)this).PrivateEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpoint) content.GetValueForProperty("PrivateEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionInternal)this).PrivateEndpoint, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.PrivateEndpointTypeConverter.ConvertFrom); } if (content.Contains("PrivateLinkServiceConnectionState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionState = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkServiceConnectionState) content.GetValueForProperty("PrivateLinkServiceConnectionState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionState, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateLinkServiceConnectionStateTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionState = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkServiceConnectionState) content.GetValueForProperty("PrivateLinkServiceConnectionState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionState, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.PrivateLinkServiceConnectionStateTypeConverter.ConvertFrom); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointConnectionProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointConnectionProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("PrivateEndpointId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionInternal)this).PrivateEndpointId = (string) content.GetValueForProperty("PrivateEndpointId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionInternal)this).PrivateEndpointId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionInternal)this).PrivateEndpointId = (string) content.GetValueForProperty("PrivateEndpointId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionInternal)this).PrivateEndpointId, global::System.Convert.ToString); } if (content.Contains("PrivateLinkServiceConnectionStateDescription")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateDescription = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateDescription",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateDescription, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateDescription = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateDescription",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateDescription, global::System.Convert.ToString); } if (content.Contains("PrivateLinkServiceConnectionStateActionsRequired")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateActionsRequired = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateActionsRequired",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateActionsRequired, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateActionsRequired = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateActionsRequired",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateActionsRequired, global::System.Convert.ToString); } if (content.Contains("PrivateLinkServiceConnectionStateStatus")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateStatus = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointServiceConnectionStatus?) content.GetValueForProperty("PrivateLinkServiceConnectionStateStatus",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateStatus, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointServiceConnectionStatus.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateStatus = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateStatus",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateStatus, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -215,6 +221,18 @@ internal PrivateEndpointConnection(global::System.Management.Automation.PSObject /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The Private Endpoint Connection resource. [System.ComponentModel.TypeConverter(typeof(PrivateEndpointConnectionTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateEndpointConnection.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateEndpointConnection.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateEndpointConnection.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/PrivateEndpointConnection.TypeConverter.cs index 72a9b880b2eb..aa33d2af66a0 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateEndpointConnection.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateEndpointConnection.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IPrivateEndpointConnection ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnection ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnection).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnection).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateEndpointConnection.cs b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateEndpointConnection.cs similarity index 53% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateEndpointConnection.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/PrivateEndpointConnection.cs index 671a4878af50..cf23325fc5d4 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateEndpointConnection.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateEndpointConnection.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// The Private Endpoint Connection resource. public partial class PrivateEndpointConnection : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnection, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionInternal, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnection, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionInternal, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBase __privateLinkResourceBase = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateLinkResourceBase(); + private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBase __privateLinkResourceBase = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.PrivateLinkResourceBase(); /// /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal)__privateLinkResourceBase).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal)__privateLinkResourceBase).Id; } /// Internal Acessors for PrivateEndpoint - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpoint Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionInternal.PrivateEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateEndpoint = value; } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpoint Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionInternal.PrivateEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateEndpoint = value; } /// Internal Acessors for PrivateEndpointId - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionInternal.PrivateEndpointId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateEndpointId; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateEndpointId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionInternal.PrivateEndpointId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateEndpointId; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateEndpointId = value; } /// Internal Acessors for PrivateLinkServiceConnectionState - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkServiceConnectionState Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionInternal.PrivateLinkServiceConnectionState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionState; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionState = value; } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkServiceConnectionState Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionInternal.PrivateLinkServiceConnectionState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionState; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionState = value; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionProperties Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateEndpointConnectionProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionProperties Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.PrivateEndpointConnectionProperties()); set { {_property = value;} } } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointConnectionProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionPropertiesInternal)Property).ProvisioningState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionPropertiesInternal)Property).ProvisioningState = value; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal)__privateLinkResourceBase).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal)__privateLinkResourceBase).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal)__privateLinkResourceBase).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal)__privateLinkResourceBase).Id = value; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal)__privateLinkResourceBase).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal)__privateLinkResourceBase).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal)__privateLinkResourceBase).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal)__privateLinkResourceBase).Name = value; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal)__privateLinkResourceBase).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal)__privateLinkResourceBase).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal)__privateLinkResourceBase).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal)__privateLinkResourceBase).Type = value; } /// The name of the resource [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal)__privateLinkResourceBase).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal)__privateLinkResourceBase).Name; } /// The ARM identifier for Private Endpoint [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string PrivateEndpointId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateEndpointId; } + public string PrivateEndpointId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateEndpointId; } /// /// A message indicating if changes on the service provider require any updates on the consumer. /// [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string PrivateLinkServiceConnectionStateActionsRequired { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionStateActionsRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionStateActionsRequired = value ?? null; } + public string PrivateLinkServiceConnectionStateActionsRequired { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionStateActionsRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionStateActionsRequired = value ?? null; } /// The reason for approval/rejection of the connection. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string PrivateLinkServiceConnectionStateDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionStateDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionStateDescription = value ?? null; } + public string PrivateLinkServiceConnectionStateDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionStateDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionStateDescription = value ?? null; } /// /// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. /// [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointServiceConnectionStatus? PrivateLinkServiceConnectionStateStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionStateStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionStateStatus = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointServiceConnectionStatus)""); } + public string PrivateLinkServiceConnectionStateStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionStateStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionStateStatus = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionProperties _property; /// Resource properties. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateEndpointConnectionProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.PrivateEndpointConnectionProperties()); set => this._property = value; } /// The provisioning state of the private endpoint connection resource. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointConnectionProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionPropertiesInternal)Property).ProvisioningState; } + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionPropertiesInternal)Property).ProvisioningState; } + + /// Gets the resource group name + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.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 type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" /// [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal)__privateLinkResourceBase).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal)__privateLinkResourceBase).Type; } /// Creates an new instance. public PrivateEndpointConnection() @@ -111,12 +115,15 @@ public PrivateEndpointConnection() /// The Private Endpoint Connection resource. public partial interface IPrivateEndpointConnection : Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBase + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBase { /// The ARM identifier for Private Endpoint [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The ARM identifier for Private Endpoint", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -127,6 +134,9 @@ public partial interface IPrivateEndpointConnection : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A message indicating if changes on the service provider require any updates on the consumer.", SerializedName = @"actionsRequired", PossibleTypes = new [] { typeof(string) })] @@ -135,6 +145,9 @@ public partial interface IPrivateEndpointConnection : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The reason for approval/rejection of the connection.", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -145,32 +158,40 @@ public partial interface IPrivateEndpointConnection : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service.", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointServiceConnectionStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointServiceConnectionStatus? PrivateLinkServiceConnectionStateStatus { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("Pending", "Approved", "Rejected")] + string PrivateLinkServiceConnectionStateStatus { get; set; } /// The provisioning state of the private endpoint connection resource. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The provisioning state of the private endpoint connection resource.", SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointConnectionProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointConnectionProvisioningState? ProvisioningState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("Succeeded", "Creating", "Deleting", "Failed")] + string ProvisioningState { get; } } /// The Private Endpoint Connection resource. internal partial interface IPrivateEndpointConnectionInternal : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal { /// The resource of private end point. - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpoint PrivateEndpoint { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpoint PrivateEndpoint { get; set; } /// The ARM identifier for Private Endpoint string PrivateEndpointId { get; set; } /// /// A collection of information about the state of the connection between service consumer and provider. /// - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get; set; } /// /// A message indicating if changes on the service provider require any updates on the consumer. /// @@ -180,11 +201,13 @@ internal partial interface IPrivateEndpointConnectionInternal : /// /// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. /// - Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointServiceConnectionStatus? PrivateLinkServiceConnectionStateStatus { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("Pending", "Approved", "Rejected")] + string PrivateLinkServiceConnectionStateStatus { get; set; } /// Resource properties. - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionProperties Property { get; set; } /// The provisioning state of the private endpoint connection resource. - Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointConnectionProvisioningState? ProvisioningState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("Succeeded", "Creating", "Deleting", "Failed")] + string ProvisioningState { get; set; } } } \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateEndpointConnection.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateEndpointConnection.json.cs similarity index 92% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateEndpointConnection.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/PrivateEndpointConnection.json.cs index 4ec1980b5460..e2254f1b5296 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateEndpointConnection.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateEndpointConnection.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class PrivateEndpointConnection partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnection. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnection. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnection. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnection. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnection FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnection FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new PrivateEndpointConnection(json) : null; } @@ -77,8 +77,8 @@ internal PrivateEndpointConnection(Microsoft.Azure.PowerShell.Cmdlets.BotService { return; } - __privateLinkResourceBase = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateLinkResourceBase(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateEndpointConnectionProperties.FromJson(__jsonProperties) : Property;} + __privateLinkResourceBase = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.PrivateLinkResourceBase(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.PrivateEndpointConnectionProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateEndpointConnectionListResult.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateEndpointConnectionListResult.PowerShell.cs similarity index 71% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateEndpointConnectionListResult.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/PrivateEndpointConnectionListResult.PowerShell.cs index 43e61459fbf4..d336a6ad6dba 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateEndpointConnectionListResult.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateEndpointConnectionListResult.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -57,29 +57,35 @@ public partial class PrivateEndpointConnectionListResult 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.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new PrivateEndpointConnectionListResult(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.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new PrivateEndpointConnectionListResult(content); } @@ -91,10 +97,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Pr /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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. @@ -109,13 +115,13 @@ internal PrivateEndpointConnectionListResult(global::System.Collections.IDiction // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnection[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateEndpointConnectionTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.PrivateEndpointConnectionTypeConverter.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 +136,7 @@ internal PrivateEndpointConnectionListResult(global::System.Management.Automatio // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnection[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateEndpointConnectionTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.PrivateEndpointConnectionTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } @@ -139,6 +145,18 @@ internal PrivateEndpointConnectionListResult(global::System.Management.Automatio /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.BotService.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(); + } } /// List of private endpoint connection associated with the specified storage account [System.ComponentModel.TypeConverter(typeof(PrivateEndpointConnectionListResultTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateEndpointConnectionListResult.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateEndpointConnectionListResult.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateEndpointConnectionListResult.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/PrivateEndpointConnectionListResult.TypeConverter.cs index 02227bd5d68f..a2b6085da4a7 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateEndpointConnectionListResult.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateEndpointConnectionListResult.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionListResult ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionListResult ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionListResult).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionListResult).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateEndpointConnectionListResult.cs b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateEndpointConnectionListResult.cs similarity index 65% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateEndpointConnectionListResult.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/PrivateEndpointConnectionListResult.cs index 4e9886abb714..d896a4cd4c8f 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateEndpointConnectionListResult.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateEndpointConnectionListResult.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -11,16 +11,16 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Previe /// List of private endpoint connection associated with the specified storage account /// public partial class PrivateEndpointConnectionListResult : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionListResult, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionListResultInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionListResult, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionListResultInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnection[] _value; + private System.Collections.Generic.List _value; /// Array of private endpoint connections [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnection[] 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 PrivateEndpointConnectionListResult() @@ -36,10 +36,13 @@ public partial interface IPrivateEndpointConnectionListResult : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Array of private endpoint connections", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnection) })] - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnection[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnection) })] + System.Collections.Generic.List Value { get; set; } } /// List of private endpoint connection associated with the specified storage account @@ -47,7 +50,7 @@ internal partial interface IPrivateEndpointConnectionListResultInternal { /// Array of private endpoint connections - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnection[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateEndpointConnectionListResult.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateEndpointConnectionListResult.json.cs similarity index 88% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateEndpointConnectionListResult.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/PrivateEndpointConnectionListResult.json.cs index b641df872fc2..d3a32b98d3f4 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateEndpointConnectionListResult.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateEndpointConnectionListResult.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class PrivateEndpointConnectionListResult partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionListResult. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionListResult. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionListResult. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionListResult. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new PrivateEndpointConnectionListResult(json) : null; } @@ -79,7 +79,7 @@ internal PrivateEndpointConnectionListResult(Microsoft.Azure.PowerShell.Cmdlets. { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IPrivateEndpointConnection) (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateEndpointConnection.FromJson(__u) )) ))() : null : Value;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.IPrivateEndpointConnection) (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.PrivateEndpointConnection.FromJson(__u) )) ))() : null : _value;} AfterFromJson(json); } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateEndpointConnectionProperties.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateEndpointConnectionProperties.PowerShell.cs similarity index 54% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateEndpointConnectionProperties.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/PrivateEndpointConnectionProperties.PowerShell.cs index 36c58bbf7edb..3934c8826fb3 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateEndpointConnectionProperties.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateEndpointConnectionProperties.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class PrivateEndpointConnectionProperties 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.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new PrivateEndpointConnectionProperties(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new PrivateEndpointConnectionProperties(content); } @@ -89,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Pr /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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,37 +113,37 @@ internal PrivateEndpointConnectionProperties(global::System.Collections.IDiction // actually deserialize if (content.Contains("PrivateEndpoint")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpoint) content.GetValueForProperty("PrivateEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpoint, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateEndpointTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpoint) content.GetValueForProperty("PrivateEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpoint, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.PrivateEndpointTypeConverter.ConvertFrom); } if (content.Contains("PrivateLinkServiceConnectionState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionState = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkServiceConnectionState) content.GetValueForProperty("PrivateLinkServiceConnectionState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionState, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateLinkServiceConnectionStateTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionState = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkServiceConnectionState) content.GetValueForProperty("PrivateLinkServiceConnectionState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionState, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.PrivateLinkServiceConnectionStateTypeConverter.ConvertFrom); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointConnectionProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointConnectionProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("PrivateEndpointId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpointId = (string) content.GetValueForProperty("PrivateEndpointId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpointId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpointId = (string) content.GetValueForProperty("PrivateEndpointId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpointId, global::System.Convert.ToString); } if (content.Contains("PrivateLinkServiceConnectionStateDescription")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateDescription = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateDescription",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateDescription, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateDescription = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateDescription",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateDescription, global::System.Convert.ToString); } if (content.Contains("PrivateLinkServiceConnectionStateActionsRequired")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateActionsRequired = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateActionsRequired",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateActionsRequired, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateActionsRequired = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateActionsRequired",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateActionsRequired, global::System.Convert.ToString); } if (content.Contains("PrivateLinkServiceConnectionStateStatus")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateStatus = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointServiceConnectionStatus?) content.GetValueForProperty("PrivateLinkServiceConnectionStateStatus",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateStatus, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointServiceConnectionStatus.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateStatus = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateStatus",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateStatus, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -152,31 +158,31 @@ internal PrivateEndpointConnectionProperties(global::System.Management.Automatio // actually deserialize if (content.Contains("PrivateEndpoint")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpoint) content.GetValueForProperty("PrivateEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpoint, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateEndpointTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpoint) content.GetValueForProperty("PrivateEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpoint, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.PrivateEndpointTypeConverter.ConvertFrom); } if (content.Contains("PrivateLinkServiceConnectionState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionState = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkServiceConnectionState) content.GetValueForProperty("PrivateLinkServiceConnectionState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionState, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateLinkServiceConnectionStateTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionState = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkServiceConnectionState) content.GetValueForProperty("PrivateLinkServiceConnectionState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionState, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.PrivateLinkServiceConnectionStateTypeConverter.ConvertFrom); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointConnectionProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointConnectionProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("PrivateEndpointId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpointId = (string) content.GetValueForProperty("PrivateEndpointId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpointId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpointId = (string) content.GetValueForProperty("PrivateEndpointId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpointId, global::System.Convert.ToString); } if (content.Contains("PrivateLinkServiceConnectionStateDescription")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateDescription = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateDescription",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateDescription, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateDescription = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateDescription",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateDescription, global::System.Convert.ToString); } if (content.Contains("PrivateLinkServiceConnectionStateActionsRequired")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateActionsRequired = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateActionsRequired",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateActionsRequired, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateActionsRequired = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateActionsRequired",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateActionsRequired, global::System.Convert.ToString); } if (content.Contains("PrivateLinkServiceConnectionStateStatus")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateStatus = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointServiceConnectionStatus?) content.GetValueForProperty("PrivateLinkServiceConnectionStateStatus",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateStatus, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointServiceConnectionStatus.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateStatus = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateStatus",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateStatus, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -185,6 +191,18 @@ internal PrivateEndpointConnectionProperties(global::System.Management.Automatio /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Properties of the PrivateEndpointConnectProperties. [System.ComponentModel.TypeConverter(typeof(PrivateEndpointConnectionPropertiesTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateEndpointConnectionProperties.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateEndpointConnectionProperties.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateEndpointConnectionProperties.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/PrivateEndpointConnectionProperties.TypeConverter.cs index 16f7b67f2a3d..d8a57446ca7c 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateEndpointConnectionProperties.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateEndpointConnectionProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateEndpointConnectionProperties.cs b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateEndpointConnectionProperties.cs similarity index 56% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateEndpointConnectionProperties.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/PrivateEndpointConnectionProperties.cs index f550b5f799e7..a0d691d44108 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateEndpointConnectionProperties.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateEndpointConnectionProperties.cs @@ -3,70 +3,70 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// Properties of the PrivateEndpointConnectProperties. public partial class PrivateEndpointConnectionProperties : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionProperties, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionProperties, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionPropertiesInternal { /// Internal Acessors for PrivateEndpoint - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpoint Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionPropertiesInternal.PrivateEndpoint { get => (this._privateEndpoint = this._privateEndpoint ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateEndpoint()); set { {_privateEndpoint = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpoint Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionPropertiesInternal.PrivateEndpoint { get => (this._privateEndpoint = this._privateEndpoint ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.PrivateEndpoint()); set { {_privateEndpoint = value;} } } /// Internal Acessors for PrivateEndpointId - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionPropertiesInternal.PrivateEndpointId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointInternal)PrivateEndpoint).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointInternal)PrivateEndpoint).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionPropertiesInternal.PrivateEndpointId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointInternal)PrivateEndpoint).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointInternal)PrivateEndpoint).Id = value; } /// Internal Acessors for PrivateLinkServiceConnectionState - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkServiceConnectionState Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionPropertiesInternal.PrivateLinkServiceConnectionState { get => (this._privateLinkServiceConnectionState = this._privateLinkServiceConnectionState ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateLinkServiceConnectionState()); set { {_privateLinkServiceConnectionState = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkServiceConnectionState Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionPropertiesInternal.PrivateLinkServiceConnectionState { get => (this._privateLinkServiceConnectionState = this._privateLinkServiceConnectionState ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.PrivateLinkServiceConnectionState()); set { {_privateLinkServiceConnectionState = value;} } } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointConnectionProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpoint _privateEndpoint; + private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpoint _privateEndpoint; /// The resource of private end point. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpoint PrivateEndpoint { get => (this._privateEndpoint = this._privateEndpoint ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateEndpoint()); set => this._privateEndpoint = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpoint PrivateEndpoint { get => (this._privateEndpoint = this._privateEndpoint ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.PrivateEndpoint()); set => this._privateEndpoint = value; } /// The ARM identifier for Private Endpoint [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string PrivateEndpointId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointInternal)PrivateEndpoint).Id; } + public string PrivateEndpointId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointInternal)PrivateEndpoint).Id; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkServiceConnectionState _privateLinkServiceConnectionState; + private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkServiceConnectionState _privateLinkServiceConnectionState; /// /// A collection of information about the state of the connection between service consumer and provider. /// [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get => (this._privateLinkServiceConnectionState = this._privateLinkServiceConnectionState ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateLinkServiceConnectionState()); set => this._privateLinkServiceConnectionState = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get => (this._privateLinkServiceConnectionState = this._privateLinkServiceConnectionState ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.PrivateLinkServiceConnectionState()); set => this._privateLinkServiceConnectionState = value; } /// /// A message indicating if changes on the service provider require any updates on the consumer. /// [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string PrivateLinkServiceConnectionStateActionsRequired { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).ActionsRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).ActionsRequired = value ?? null; } + public string PrivateLinkServiceConnectionStateActionsRequired { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).ActionsRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).ActionsRequired = value ?? null; } /// The reason for approval/rejection of the connection. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string PrivateLinkServiceConnectionStateDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).Description = value ?? null; } + public string PrivateLinkServiceConnectionStateDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).Description = value ?? null; } /// /// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. /// [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointServiceConnectionStatus? PrivateLinkServiceConnectionStateStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).Status = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointServiceConnectionStatus)""); } + public string PrivateLinkServiceConnectionStateStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).Status = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointConnectionProvisioningState? _provisioningState; + private string _provisioningState; /// The provisioning state of the private endpoint connection resource. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointConnectionProvisioningState? ProvisioningState { get => this._provisioningState; } + public string ProvisioningState { get => this._provisioningState; } /// Creates an new instance. public PrivateEndpointConnectionProperties() @@ -82,6 +82,9 @@ public partial interface IPrivateEndpointConnectionProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The ARM identifier for Private Endpoint", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -92,6 +95,9 @@ public partial interface IPrivateEndpointConnectionProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A message indicating if changes on the service provider require any updates on the consumer.", SerializedName = @"actionsRequired", PossibleTypes = new [] { typeof(string) })] @@ -100,6 +106,9 @@ public partial interface IPrivateEndpointConnectionProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The reason for approval/rejection of the connection.", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -110,18 +119,26 @@ public partial interface IPrivateEndpointConnectionProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service.", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointServiceConnectionStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointServiceConnectionStatus? PrivateLinkServiceConnectionStateStatus { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("Pending", "Approved", "Rejected")] + string PrivateLinkServiceConnectionStateStatus { get; set; } /// The provisioning state of the private endpoint connection resource. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The provisioning state of the private endpoint connection resource.", SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointConnectionProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointConnectionProvisioningState? ProvisioningState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("Succeeded", "Creating", "Deleting", "Failed")] + string ProvisioningState { get; } } /// Properties of the PrivateEndpointConnectProperties. @@ -129,13 +146,13 @@ internal partial interface IPrivateEndpointConnectionPropertiesInternal { /// The resource of private end point. - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpoint PrivateEndpoint { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpoint PrivateEndpoint { get; set; } /// The ARM identifier for Private Endpoint string PrivateEndpointId { get; set; } /// /// A collection of information about the state of the connection between service consumer and provider. /// - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get; set; } /// /// A message indicating if changes on the service provider require any updates on the consumer. /// @@ -145,9 +162,11 @@ internal partial interface IPrivateEndpointConnectionPropertiesInternal /// /// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. /// - Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointServiceConnectionStatus? PrivateLinkServiceConnectionStateStatus { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("Pending", "Approved", "Rejected")] + string PrivateLinkServiceConnectionStateStatus { get; set; } /// The provisioning state of the private endpoint connection resource. - Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointConnectionProvisioningState? ProvisioningState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("Succeeded", "Creating", "Deleting", "Failed")] + string ProvisioningState { get; set; } } } \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateEndpointConnectionProperties.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateEndpointConnectionProperties.json.cs similarity index 90% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateEndpointConnectionProperties.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/PrivateEndpointConnectionProperties.json.cs index 041089d5ce0e..1a70b345955a 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateEndpointConnectionProperties.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateEndpointConnectionProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class PrivateEndpointConnectionProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateEndpointConnectionProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new PrivateEndpointConnectionProperties(json) : null; } @@ -77,9 +77,9 @@ internal PrivateEndpointConnectionProperties(Microsoft.Azure.PowerShell.Cmdlets. { return; } - {_privateEndpoint = If( json?.PropertyT("privateEndpoint"), out var __jsonPrivateEndpoint) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateEndpoint.FromJson(__jsonPrivateEndpoint) : PrivateEndpoint;} - {_privateLinkServiceConnectionState = If( json?.PropertyT("privateLinkServiceConnectionState"), out var __jsonPrivateLinkServiceConnectionState) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateLinkServiceConnectionState.FromJson(__jsonPrivateLinkServiceConnectionState) : PrivateLinkServiceConnectionState;} - {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} + {_privateEndpoint = If( json?.PropertyT("privateEndpoint"), out var __jsonPrivateEndpoint) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.PrivateEndpoint.FromJson(__jsonPrivateEndpoint) : _privateEndpoint;} + {_privateLinkServiceConnectionState = If( json?.PropertyT("privateLinkServiceConnectionState"), out var __jsonPrivateLinkServiceConnectionState) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.PrivateLinkServiceConnectionState.FromJson(__jsonPrivateLinkServiceConnectionState) : _privateLinkServiceConnectionState;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} AfterFromJson(json); } @@ -105,7 +105,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode ToJso } AddIf( null != this._privateEndpoint ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) this._privateEndpoint.ToJson(null,serializationMode) : null, "privateEndpoint" ,container.Add ); AddIf( null != this._privateLinkServiceConnectionState ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) this._privateLinkServiceConnectionState.ToJson(null,serializationMode) : null, "privateLinkServiceConnectionState" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateLinkResource.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateLinkResource.PowerShell.cs similarity index 60% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateLinkResource.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/PrivateLinkResource.PowerShell.cs index c22082a1941a..d882545916e3 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateLinkResource.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateLinkResource.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class PrivateLinkResource 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.BotService.Models.Api20220615Preview.IPrivateLinkResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResource DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new PrivateLinkResource(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.BotService.Models.Api20220615Preview.IPrivateLinkResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new PrivateLinkResource(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Pr /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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 +111,37 @@ internal PrivateLinkResource(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateLinkResourcePropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.PrivateLinkResourcePropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("GroupId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceInternal)this).GroupId = (string) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceInternal)this).GroupId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceInternal)this).GroupId = (string) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceInternal)this).GroupId, global::System.Convert.ToString); } if (content.Contains("RequiredMember")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceInternal)this).RequiredMember = (string[]) content.GetValueForProperty("RequiredMember",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceInternal)this).RequiredMember, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceInternal)this).RequiredMember = (System.Collections.Generic.List) content.GetValueForProperty("RequiredMember",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceInternal)this).RequiredMember, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("RequiredZoneName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceInternal)this).RequiredZoneName = (string[]) content.GetValueForProperty("RequiredZoneName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceInternal)this).RequiredZoneName, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceInternal)this).RequiredZoneName = (System.Collections.Generic.List) content.GetValueForProperty("RequiredZoneName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceInternal)this).RequiredZoneName, __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. @@ -150,31 +156,31 @@ internal PrivateLinkResource(global::System.Management.Automation.PSObject conte // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateLinkResourcePropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.PrivateLinkResourcePropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("GroupId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceInternal)this).GroupId = (string) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceInternal)this).GroupId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceInternal)this).GroupId = (string) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceInternal)this).GroupId, global::System.Convert.ToString); } if (content.Contains("RequiredMember")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceInternal)this).RequiredMember = (string[]) content.GetValueForProperty("RequiredMember",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceInternal)this).RequiredMember, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceInternal)this).RequiredMember = (System.Collections.Generic.List) content.GetValueForProperty("RequiredMember",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceInternal)this).RequiredMember, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("RequiredZoneName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceInternal)this).RequiredZoneName = (string[]) content.GetValueForProperty("RequiredZoneName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceInternal)this).RequiredZoneName, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceInternal)this).RequiredZoneName = (System.Collections.Generic.List) content.GetValueForProperty("RequiredZoneName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceInternal)this).RequiredZoneName, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializePSObject(content); } @@ -183,6 +189,18 @@ internal PrivateLinkResource(global::System.Management.Automation.PSObject conte /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.BotService.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 private link resource [System.ComponentModel.TypeConverter(typeof(PrivateLinkResourceTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateLinkResource.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateLinkResource.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateLinkResource.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/PrivateLinkResource.TypeConverter.cs index 1126a252a7e0..c4c07fbdd439 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateLinkResource.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateLinkResource.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IPrivateLinkResource ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResource ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResource).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResource).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateLinkResource.cs b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateLinkResource.cs similarity index 57% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateLinkResource.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/PrivateLinkResource.cs index f62f3ab6ffaa..a516d6a0197c 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateLinkResource.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateLinkResource.cs @@ -3,74 +3,74 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// A private link resource public partial class PrivateLinkResource : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResource, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResource, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceInternal, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBase __privateLinkResourceBase = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateLinkResourceBase(); + private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBase __privateLinkResourceBase = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.PrivateLinkResourceBase(); /// The private link resource group id. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string GroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourcePropertiesInternal)Property).GroupId; } + public string GroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourcePropertiesInternal)Property).GroupId; } /// /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal)__privateLinkResourceBase).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal)__privateLinkResourceBase).Id; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal)__privateLinkResourceBase).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal)__privateLinkResourceBase).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal)__privateLinkResourceBase).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal)__privateLinkResourceBase).Id = value; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal)__privateLinkResourceBase).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal)__privateLinkResourceBase).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal)__privateLinkResourceBase).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal)__privateLinkResourceBase).Name = value; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal)__privateLinkResourceBase).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal)__privateLinkResourceBase).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal)__privateLinkResourceBase).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal)__privateLinkResourceBase).Type = value; } /// Internal Acessors for GroupId - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceInternal.GroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourcePropertiesInternal)Property).GroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourcePropertiesInternal)Property).GroupId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceInternal.GroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourcePropertiesInternal)Property).GroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourcePropertiesInternal)Property).GroupId = value; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceProperties Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateLinkResourceProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceProperties Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.PrivateLinkResourceProperties()); set { {_property = value;} } } /// Internal Acessors for RequiredMember - string[] Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceInternal.RequiredMember { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourcePropertiesInternal)Property).RequiredMember; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourcePropertiesInternal)Property).RequiredMember = value; } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceInternal.RequiredMember { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourcePropertiesInternal)Property).RequiredMember; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourcePropertiesInternal)Property).RequiredMember = value; } /// The name of the resource [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal)__privateLinkResourceBase).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal)__privateLinkResourceBase).Name; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceProperties _property; /// Resource properties. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateLinkResourceProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.PrivateLinkResourceProperties()); set => this._property = value; } /// The private link resource required member names. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string[] RequiredMember { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourcePropertiesInternal)Property).RequiredMember; } + public System.Collections.Generic.List RequiredMember { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourcePropertiesInternal)Property).RequiredMember; } /// The private link resource Private link DNS zone name. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string[] RequiredZoneName { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourcePropertiesInternal)Property).RequiredZoneName; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourcePropertiesInternal)Property).RequiredZoneName = value ?? null /* arrayOf */; } + public System.Collections.Generic.List RequiredZoneName { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourcePropertiesInternal)Property).RequiredZoneName; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourcePropertiesInternal)Property).RequiredZoneName = value ?? null /* arrayOf */; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" /// [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal)__privateLinkResourceBase).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal)__privateLinkResourceBase).Type; } /// Creates an new instance. public PrivateLinkResource() @@ -93,12 +93,15 @@ public PrivateLinkResource() /// A private link resource public partial interface IPrivateLinkResource : Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBase + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBase { /// The private link resource group id. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The private link resource group id.", SerializedName = @"groupId", PossibleTypes = new [] { typeof(string) })] @@ -107,32 +110,38 @@ public partial interface IPrivateLinkResource : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The private link resource required member names.", SerializedName = @"requiredMembers", PossibleTypes = new [] { typeof(string) })] - string[] RequiredMember { get; } + System.Collections.Generic.List RequiredMember { get; } /// The private link resource Private link DNS zone name. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The private link resource Private link DNS zone name.", SerializedName = @"requiredZoneNames", PossibleTypes = new [] { typeof(string) })] - string[] RequiredZoneName { get; set; } + System.Collections.Generic.List RequiredZoneName { get; set; } } /// A private link resource internal partial interface IPrivateLinkResourceInternal : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal { /// The private link resource group id. string GroupId { get; set; } /// Resource properties. - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceProperties Property { get; set; } /// The private link resource required member names. - string[] RequiredMember { get; set; } + System.Collections.Generic.List RequiredMember { get; set; } /// The private link resource Private link DNS zone name. - string[] RequiredZoneName { get; set; } + System.Collections.Generic.List RequiredZoneName { get; set; } } } \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateLinkResource.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateLinkResource.json.cs similarity index 92% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateLinkResource.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/PrivateLinkResource.json.cs index f61bc681dd12..890ac30b2a6e 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateLinkResource.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateLinkResource.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class PrivateLinkResource partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResource. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResource. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResource. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResource. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new PrivateLinkResource(json) : null; } @@ -77,8 +77,8 @@ internal PrivateLinkResource(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runti { return; } - __privateLinkResourceBase = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateLinkResourceBase(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateLinkResourceProperties.FromJson(__jsonProperties) : Property;} + __privateLinkResourceBase = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.PrivateLinkResourceBase(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.PrivateLinkResourceProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateLinkResourceBase.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateLinkResourceBase.PowerShell.cs similarity index 71% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateLinkResourceBase.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/PrivateLinkResourceBase.PowerShell.cs index 004ff769b4ab..ef695e6e43ff 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateLinkResourceBase.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateLinkResourceBase.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -57,29 +57,35 @@ public partial class PrivateLinkResourceBase 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.BotService.Models.Api20220615Preview.IPrivateLinkResourceBase DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBase DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new PrivateLinkResourceBase(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.BotService.Models.Api20220615Preview.IPrivateLinkResourceBase DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBase DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new PrivateLinkResourceBase(content); } @@ -89,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Pr /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBase FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBase FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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,21 +113,21 @@ internal PrivateLinkResourceBase(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal)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. @@ -136,15 +142,15 @@ internal PrivateLinkResourceBase(global::System.Management.Automation.PSObject c // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal)this).Type, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -153,6 +159,18 @@ internal PrivateLinkResourceBase(global::System.Management.Automation.PSObject c /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.BotService.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(); + } } /// Common fields that are returned in the response for all BotService Private Link Resources [System.ComponentModel.TypeConverter(typeof(PrivateLinkResourceBaseTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateLinkResourceBase.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateLinkResourceBase.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateLinkResourceBase.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/PrivateLinkResourceBase.TypeConverter.cs index b5a1c96c765f..1f650e2c3321 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateLinkResourceBase.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateLinkResourceBase.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IPrivateLinkResourceBase ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBase ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBase).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBase).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateLinkResourceBase.cs b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateLinkResourceBase.cs similarity index 87% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateLinkResourceBase.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/PrivateLinkResourceBase.cs index 1406537b2dce..01eac0f7de11 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateLinkResourceBase.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateLinkResourceBase.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -11,8 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Previe /// Common fields that are returned in the response for all BotService Private Link Resources /// public partial class PrivateLinkResourceBase : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBase, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBase, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal { /// Backing field for property. @@ -25,13 +25,13 @@ public partial class PrivateLinkResourceBase : public string Id { get => this._id; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal.Id { get => this._id; set { {_id = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal.Id { get => this._id; set { {_id = value;} } } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal.Name { get => this._name; set { {_name = value;} } } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBaseInternal.Type { get => this._type; set { {_type = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBaseInternal.Type { get => this._type; set { {_type = value;} } } /// Backing field for property. private string _name; @@ -65,6 +65,9 @@ public partial interface IPrivateLinkResourceBase : [Microsoft.Azure.PowerShell.Cmdlets.BotService.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 IPrivateLinkResourceBase : [Microsoft.Azure.PowerShell.Cmdlets.BotService.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 IPrivateLinkResourceBase : [Microsoft.Azure.PowerShell.Cmdlets.BotService.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/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateLinkResourceBase.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateLinkResourceBase.json.cs similarity index 91% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateLinkResourceBase.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/PrivateLinkResourceBase.json.cs index 62d93c88a8bd..17ff1c22043b 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateLinkResourceBase.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateLinkResourceBase.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class PrivateLinkResourceBase partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBase. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBase. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBase. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBase. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceBase FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceBase FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new PrivateLinkResourceBase(json) : null; } @@ -79,9 +79,9 @@ internal PrivateLinkResourceBase(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Json.JsonNode ToJso { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateLinkResourceListResult.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateLinkResourceListResult.PowerShell.cs similarity index 71% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateLinkResourceListResult.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/PrivateLinkResourceListResult.PowerShell.cs index a93582cb125b..7d09aa715f6e 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateLinkResourceListResult.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateLinkResourceListResult.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class PrivateLinkResourceListResult 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.BotService.Models.Api20220615Preview.IPrivateLinkResourceListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new PrivateLinkResourceListResult(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.BotService.Models.Api20220615Preview.IPrivateLinkResourceListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new PrivateLinkResourceListResult(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Pr /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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,13 +111,13 @@ internal PrivateLinkResourceListResult(global::System.Collections.IDictionary co // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResource[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateLinkResourceTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.PrivateLinkResourceTypeConverter.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. @@ -126,7 +132,7 @@ internal PrivateLinkResourceListResult(global::System.Management.Automation.PSOb // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResource[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateLinkResourceTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.PrivateLinkResourceTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } @@ -135,6 +141,18 @@ internal PrivateLinkResourceListResult(global::System.Management.Automation.PSOb /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.BotService.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 list of private link resources [System.ComponentModel.TypeConverter(typeof(PrivateLinkResourceListResultTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateLinkResourceListResult.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateLinkResourceListResult.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateLinkResourceListResult.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/PrivateLinkResourceListResult.TypeConverter.cs index b150b3ef26d8..a4d12b137162 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateLinkResourceListResult.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateLinkResourceListResult.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IPrivateLinkResourceListResult ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceListResult ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceListResult).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceListResult).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateLinkResourceListResult.cs b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateLinkResourceListResult.cs similarity index 63% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateLinkResourceListResult.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/PrivateLinkResourceListResult.cs index 8d7fa55edc2d..ad909e52929d 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateLinkResourceListResult.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateLinkResourceListResult.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// A list of private link resources public partial class PrivateLinkResourceListResult : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceListResult, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceListResultInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceListResult, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceListResultInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResource[] _value; + private System.Collections.Generic.List _value; /// Array of private link resources [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResource[] 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 PrivateLinkResourceListResult() @@ -34,10 +34,13 @@ public partial interface IPrivateLinkResourceListResult : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Array of private link resources", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResource) })] - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResource[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResource) })] + System.Collections.Generic.List Value { get; set; } } /// A list of private link resources @@ -45,7 +48,7 @@ internal partial interface IPrivateLinkResourceListResultInternal { /// Array of private link resources - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResource[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateLinkResourceListResult.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateLinkResourceListResult.json.cs similarity index 89% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateLinkResourceListResult.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/PrivateLinkResourceListResult.json.cs index 05cb1baf5aa5..3e52fcd0519f 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateLinkResourceListResult.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateLinkResourceListResult.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class PrivateLinkResourceListResult partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceListResult. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceListResult. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceListResult. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceListResult. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new PrivateLinkResourceListResult(json) : null; } @@ -77,7 +77,7 @@ internal PrivateLinkResourceListResult(Microsoft.Azure.PowerShell.Cmdlets.BotSer { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IPrivateLinkResource) (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateLinkResource.FromJson(__u) )) ))() : null : Value;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.IPrivateLinkResource) (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.PrivateLinkResource.FromJson(__u) )) ))() : null : _value;} AfterFromJson(json); } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateLinkResourceProperties.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateLinkResourceProperties.PowerShell.cs similarity index 67% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateLinkResourceProperties.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/PrivateLinkResourceProperties.PowerShell.cs index bb99f6be81ed..42894e286bb9 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateLinkResourceProperties.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateLinkResourceProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class PrivateLinkResourceProperties 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.BotService.Models.Api20220615Preview.IPrivateLinkResourceProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new PrivateLinkResourceProperties(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.BotService.Models.Api20220615Preview.IPrivateLinkResourceProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new PrivateLinkResourceProperties(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Pr /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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 PrivateLinkResourceProperties(global::System.Collections.IDictionary co // actually deserialize if (content.Contains("GroupId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourcePropertiesInternal)this).GroupId = (string) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourcePropertiesInternal)this).GroupId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourcePropertiesInternal)this).GroupId = (string) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourcePropertiesInternal)this).GroupId, global::System.Convert.ToString); } if (content.Contains("RequiredMember")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourcePropertiesInternal)this).RequiredMember = (string[]) content.GetValueForProperty("RequiredMember",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourcePropertiesInternal)this).RequiredMember, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourcePropertiesInternal)this).RequiredMember = (System.Collections.Generic.List) content.GetValueForProperty("RequiredMember",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourcePropertiesInternal)this).RequiredMember, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("RequiredZoneName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourcePropertiesInternal)this).RequiredZoneName = (string[]) content.GetValueForProperty("RequiredZoneName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourcePropertiesInternal)this).RequiredZoneName, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourcePropertiesInternal)this).RequiredZoneName = (System.Collections.Generic.List) content.GetValueForProperty("RequiredZoneName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourcePropertiesInternal)this).RequiredZoneName, __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. @@ -134,15 +140,15 @@ internal PrivateLinkResourceProperties(global::System.Management.Automation.PSOb // actually deserialize if (content.Contains("GroupId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourcePropertiesInternal)this).GroupId = (string) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourcePropertiesInternal)this).GroupId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourcePropertiesInternal)this).GroupId = (string) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourcePropertiesInternal)this).GroupId, global::System.Convert.ToString); } if (content.Contains("RequiredMember")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourcePropertiesInternal)this).RequiredMember = (string[]) content.GetValueForProperty("RequiredMember",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourcePropertiesInternal)this).RequiredMember, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourcePropertiesInternal)this).RequiredMember = (System.Collections.Generic.List) content.GetValueForProperty("RequiredMember",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourcePropertiesInternal)this).RequiredMember, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("RequiredZoneName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourcePropertiesInternal)this).RequiredZoneName = (string[]) content.GetValueForProperty("RequiredZoneName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourcePropertiesInternal)this).RequiredZoneName, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourcePropertiesInternal)this).RequiredZoneName = (System.Collections.Generic.List) content.GetValueForProperty("RequiredZoneName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourcePropertiesInternal)this).RequiredZoneName, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializePSObject(content); } @@ -151,6 +157,18 @@ internal PrivateLinkResourceProperties(global::System.Management.Automation.PSOb /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Properties of a private link resource. [System.ComponentModel.TypeConverter(typeof(PrivateLinkResourcePropertiesTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateLinkResourceProperties.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateLinkResourceProperties.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateLinkResourceProperties.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/PrivateLinkResourceProperties.TypeConverter.cs index 3c0e7e226617..196b89da8bbe 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateLinkResourceProperties.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateLinkResourceProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IPrivateLinkResourceProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateLinkResourceProperties.cs b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateLinkResourceProperties.cs similarity index 70% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateLinkResourceProperties.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/PrivateLinkResourceProperties.cs index ced5d0865c1f..4f17f8b84f42 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateLinkResourceProperties.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateLinkResourceProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// Properties of a private link resource. public partial class PrivateLinkResourceProperties : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceProperties, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourcePropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceProperties, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourcePropertiesInternal { /// Backing field for property. @@ -21,24 +21,24 @@ public partial class PrivateLinkResourceProperties : public string GroupId { get => this._groupId; } /// Internal Acessors for GroupId - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourcePropertiesInternal.GroupId { get => this._groupId; set { {_groupId = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourcePropertiesInternal.GroupId { get => this._groupId; set { {_groupId = value;} } } /// Internal Acessors for RequiredMember - string[] Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourcePropertiesInternal.RequiredMember { get => this._requiredMember; set { {_requiredMember = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourcePropertiesInternal.RequiredMember { get => this._requiredMember; set { {_requiredMember = value;} } } /// Backing field for property. - private string[] _requiredMember; + private System.Collections.Generic.List _requiredMember; /// The private link resource required member names. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Owned)] - public string[] RequiredMember { get => this._requiredMember; } + public System.Collections.Generic.List RequiredMember { get => this._requiredMember; } /// Backing field for property. - private string[] _requiredZoneName; + private System.Collections.Generic.List _requiredZoneName; /// The private link resource Private link DNS zone name. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Owned)] - public string[] RequiredZoneName { get => this._requiredZoneName; set => this._requiredZoneName = value; } + public System.Collections.Generic.List RequiredZoneName { get => this._requiredZoneName; set => this._requiredZoneName = value; } /// Creates an new instance. public PrivateLinkResourceProperties() @@ -54,6 +54,9 @@ public partial interface IPrivateLinkResourceProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The private link resource group id.", SerializedName = @"groupId", PossibleTypes = new [] { typeof(string) })] @@ -62,18 +65,24 @@ public partial interface IPrivateLinkResourceProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The private link resource required member names.", SerializedName = @"requiredMembers", PossibleTypes = new [] { typeof(string) })] - string[] RequiredMember { get; } + System.Collections.Generic.List RequiredMember { get; } /// The private link resource Private link DNS zone name. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The private link resource Private link DNS zone name.", SerializedName = @"requiredZoneNames", PossibleTypes = new [] { typeof(string) })] - string[] RequiredZoneName { get; set; } + System.Collections.Generic.List RequiredZoneName { get; set; } } /// Properties of a private link resource. @@ -83,9 +92,9 @@ internal partial interface IPrivateLinkResourcePropertiesInternal /// The private link resource group id. string GroupId { get; set; } /// The private link resource required member names. - string[] RequiredMember { get; set; } + System.Collections.Generic.List RequiredMember { get; set; } /// The private link resource Private link DNS zone name. - string[] RequiredZoneName { get; set; } + System.Collections.Generic.List RequiredZoneName { get; set; } } } \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateLinkResourceProperties.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateLinkResourceProperties.json.cs similarity index 87% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateLinkResourceProperties.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/PrivateLinkResourceProperties.json.cs index 3d679866f1ae..d600c10b1be0 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateLinkResourceProperties.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateLinkResourceProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class PrivateLinkResourceProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResourceProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkResourceProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new PrivateLinkResourceProperties(json) : null; } @@ -77,9 +77,9 @@ internal PrivateLinkResourceProperties(Microsoft.Azure.PowerShell.Cmdlets.BotSer { return; } - {_groupId = If( json?.PropertyT("groupId"), out var __jsonGroupId) ? (string)__jsonGroupId : (string)GroupId;} - {_requiredMember = If( json?.PropertyT("requiredMembers"), out var __jsonRequiredMembers) ? If( __jsonRequiredMembers as Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : RequiredMember;} - {_requiredZoneName = If( json?.PropertyT("requiredZoneNames"), out var __jsonRequiredZoneNames) ? If( __jsonRequiredZoneNames as Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : RequiredZoneName;} + {_groupId = If( json?.PropertyT("groupId"), out var __jsonGroupId) ? (string)__jsonGroupId : (string)_groupId;} + {_requiredMember = If( json?.PropertyT("requiredMembers"), out var __jsonRequiredMembers) ? If( __jsonRequiredMembers as Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _requiredMember;} + {_requiredZoneName = If( json?.PropertyT("requiredZoneNames"), out var __jsonRequiredZoneNames) ? If( __jsonRequiredZoneNames as Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : _requiredZoneName;} AfterFromJson(json); } @@ -102,11 +102,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode ToJso { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._groupId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._groupId.ToString()) : null, "groupId" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)) { if (null != this._requiredMember) { diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateLinkServiceConnectionState.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateLinkServiceConnectionState.PowerShell.cs similarity index 70% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateLinkServiceConnectionState.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/PrivateLinkServiceConnectionState.PowerShell.cs index dac35ad1a5d7..aecbb62bdc26 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateLinkServiceConnectionState.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateLinkServiceConnectionState.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -57,29 +57,35 @@ public partial class PrivateLinkServiceConnectionState 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.BotService.Models.Api20220615Preview.IPrivateLinkServiceConnectionState DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkServiceConnectionState DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new PrivateLinkServiceConnectionState(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkServiceConnectionState DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkServiceConnectionState DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new PrivateLinkServiceConnectionState(content); } @@ -91,10 +97,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Pr /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkServiceConnectionState FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkServiceConnectionState FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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. @@ -109,21 +115,21 @@ internal PrivateLinkServiceConnectionState(global::System.Collections.IDictionar // actually deserialize if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkServiceConnectionStateInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointServiceConnectionStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkServiceConnectionStateInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointServiceConnectionStatus.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkServiceConnectionStateInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkServiceConnectionStateInternal)this).Status, global::System.Convert.ToString); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkServiceConnectionStateInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkServiceConnectionStateInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkServiceConnectionStateInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkServiceConnectionStateInternal)this).Description, global::System.Convert.ToString); } if (content.Contains("ActionsRequired")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkServiceConnectionStateInternal)this).ActionsRequired = (string) content.GetValueForProperty("ActionsRequired",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkServiceConnectionStateInternal)this).ActionsRequired, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkServiceConnectionStateInternal)this).ActionsRequired = (string) content.GetValueForProperty("ActionsRequired",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkServiceConnectionStateInternal)this).ActionsRequired, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -138,15 +144,15 @@ internal PrivateLinkServiceConnectionState(global::System.Management.Automation. // actually deserialize if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkServiceConnectionStateInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointServiceConnectionStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkServiceConnectionStateInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointServiceConnectionStatus.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkServiceConnectionStateInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkServiceConnectionStateInternal)this).Status, global::System.Convert.ToString); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkServiceConnectionStateInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkServiceConnectionStateInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkServiceConnectionStateInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkServiceConnectionStateInternal)this).Description, global::System.Convert.ToString); } if (content.Contains("ActionsRequired")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkServiceConnectionStateInternal)this).ActionsRequired = (string) content.GetValueForProperty("ActionsRequired",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkServiceConnectionStateInternal)this).ActionsRequired, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkServiceConnectionStateInternal)this).ActionsRequired = (string) content.GetValueForProperty("ActionsRequired",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkServiceConnectionStateInternal)this).ActionsRequired, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -155,6 +161,18 @@ internal PrivateLinkServiceConnectionState(global::System.Management.Automation. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.BotService.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 collection of information about the state of the connection between service consumer and provider. [System.ComponentModel.TypeConverter(typeof(PrivateLinkServiceConnectionStateTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateLinkServiceConnectionState.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateLinkServiceConnectionState.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateLinkServiceConnectionState.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/PrivateLinkServiceConnectionState.TypeConverter.cs index 4fbb01a29dc1..a2ccc4c323f2 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateLinkServiceConnectionState.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateLinkServiceConnectionState.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IPrivateLinkServiceConnectionState ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkServiceConnectionState ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkServiceConnectionState).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkServiceConnectionState).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateLinkServiceConnectionState.cs b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateLinkServiceConnectionState.cs similarity index 81% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateLinkServiceConnectionState.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/PrivateLinkServiceConnectionState.cs index 9eccfb8cb93f..43ee3e80b133 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateLinkServiceConnectionState.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateLinkServiceConnectionState.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -11,8 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Previe /// A collection of information about the state of the connection between service consumer and provider. /// public partial class PrivateLinkServiceConnectionState : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkServiceConnectionState, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkServiceConnectionStateInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkServiceConnectionState, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkServiceConnectionStateInternal { /// Backing field for property. @@ -32,13 +32,13 @@ public partial class PrivateLinkServiceConnectionState : public string Description { get => this._description; set => this._description = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointServiceConnectionStatus? _status; + private string _status; /// /// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. /// [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointServiceConnectionStatus? Status { get => this._status; set => this._status = value; } + public string Status { get => this._status; set => this._status = value; } /// Creates an new instance. public PrivateLinkServiceConnectionState() @@ -56,6 +56,9 @@ public partial interface IPrivateLinkServiceConnectionState : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A message indicating if changes on the service provider require any updates on the consumer.", SerializedName = @"actionsRequired", PossibleTypes = new [] { typeof(string) })] @@ -64,6 +67,9 @@ public partial interface IPrivateLinkServiceConnectionState : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The reason for approval/rejection of the connection.", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -74,10 +80,14 @@ public partial interface IPrivateLinkServiceConnectionState : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service.", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointServiceConnectionStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointServiceConnectionStatus? Status { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("Pending", "Approved", "Rejected")] + string Status { get; set; } } /// A collection of information about the state of the connection between service consumer and provider. @@ -93,7 +103,8 @@ internal partial interface IPrivateLinkServiceConnectionStateInternal /// /// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. /// - Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointServiceConnectionStatus? Status { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("Pending", "Approved", "Rejected")] + string Status { get; set; } } } \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateLinkServiceConnectionState.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateLinkServiceConnectionState.json.cs similarity index 93% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateLinkServiceConnectionState.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/PrivateLinkServiceConnectionState.json.cs index cc56dc02cf46..0f70e2cd1f21 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/PrivateLinkServiceConnectionState.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/PrivateLinkServiceConnectionState.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class PrivateLinkServiceConnectionState partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkServiceConnectionState. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkServiceConnectionState. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkServiceConnectionState. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkServiceConnectionState. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkServiceConnectionState FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IPrivateLinkServiceConnectionState FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new PrivateLinkServiceConnectionState(json) : null; } @@ -79,9 +79,9 @@ internal PrivateLinkServiceConnectionState(Microsoft.Azure.PowerShell.Cmdlets.Bo { return; } - {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} - {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} - {_actionsRequired = If( json?.PropertyT("actionsRequired"), out var __jsonActionsRequired) ? (string)__jsonActionsRequired : (string)ActionsRequired;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)_status;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)_description;} + {_actionsRequired = If( json?.PropertyT("actionsRequired"), out var __jsonActionsRequired) ? (string)__jsonActionsRequired : (string)_actionsRequired;} AfterFromJson(json); } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/QnAMakerEndpointKeysRequestBody.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/QnAMakerEndpointKeysRequestBody.PowerShell.cs similarity index 73% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/QnAMakerEndpointKeysRequestBody.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/QnAMakerEndpointKeysRequestBody.PowerShell.cs index a6f5a044ba3b..3663b8a7bad0 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/QnAMakerEndpointKeysRequestBody.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/QnAMakerEndpointKeysRequestBody.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -57,29 +57,35 @@ public partial class QnAMakerEndpointKeysRequestBody 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.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysRequestBody DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysRequestBody DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new QnAMakerEndpointKeysRequestBody(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.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysRequestBody DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysRequestBody DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new QnAMakerEndpointKeysRequestBody(content); } @@ -89,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Pr /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysRequestBody FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysRequestBody FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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 +113,17 @@ internal QnAMakerEndpointKeysRequestBody(global::System.Collections.IDictionary // actually deserialize if (content.Contains("Hostname")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysRequestBodyInternal)this).Hostname = (string) content.GetValueForProperty("Hostname",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysRequestBodyInternal)this).Hostname, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysRequestBodyInternal)this).Hostname = (string) content.GetValueForProperty("Hostname",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysRequestBodyInternal)this).Hostname, global::System.Convert.ToString); } if (content.Contains("Authkey")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysRequestBodyInternal)this).Authkey = (string) content.GetValueForProperty("Authkey",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysRequestBodyInternal)this).Authkey, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysRequestBodyInternal)this).Authkey = (string) content.GetValueForProperty("Authkey",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysRequestBodyInternal)this).Authkey, 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 +138,11 @@ internal QnAMakerEndpointKeysRequestBody(global::System.Management.Automation.PS // actually deserialize if (content.Contains("Hostname")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysRequestBodyInternal)this).Hostname = (string) content.GetValueForProperty("Hostname",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysRequestBodyInternal)this).Hostname, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysRequestBodyInternal)this).Hostname = (string) content.GetValueForProperty("Hostname",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysRequestBodyInternal)this).Hostname, global::System.Convert.ToString); } if (content.Contains("Authkey")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysRequestBodyInternal)this).Authkey = (string) content.GetValueForProperty("Authkey",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysRequestBodyInternal)this).Authkey, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysRequestBodyInternal)this).Authkey = (string) content.GetValueForProperty("Authkey",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysRequestBodyInternal)this).Authkey, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -145,6 +151,18 @@ internal QnAMakerEndpointKeysRequestBody(global::System.Management.Automation.PS /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.BotService.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 request body for a request to Bot Service Management to list QnA Maker endpoint keys. [System.ComponentModel.TypeConverter(typeof(QnAMakerEndpointKeysRequestBodyTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/QnAMakerEndpointKeysRequestBody.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/QnAMakerEndpointKeysRequestBody.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/QnAMakerEndpointKeysRequestBody.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/QnAMakerEndpointKeysRequestBody.TypeConverter.cs index 93f29e2403ef..346cadeb8290 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/QnAMakerEndpointKeysRequestBody.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/QnAMakerEndpointKeysRequestBody.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysRequestBody ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysRequestBody ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysRequestBody).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysRequestBody).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/QnAMakerEndpointKeysRequestBody.cs b/generated/BotService/BotService.Autorest/generated/api/Models/QnAMakerEndpointKeysRequestBody.cs similarity index 88% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/QnAMakerEndpointKeysRequestBody.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/QnAMakerEndpointKeysRequestBody.cs index 0b1e80f8c9f3..0734a72033e6 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/QnAMakerEndpointKeysRequestBody.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/QnAMakerEndpointKeysRequestBody.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -11,8 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Previe /// The request body for a request to Bot Service Management to list QnA Maker endpoint keys. /// public partial class QnAMakerEndpointKeysRequestBody : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysRequestBody, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysRequestBodyInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysRequestBody, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysRequestBodyInternal { /// Backing field for property. @@ -43,6 +43,9 @@ public partial interface IQnAMakerEndpointKeysRequestBody : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Subscription key which provides access to this API.", SerializedName = @"authkey", PossibleTypes = new [] { typeof(string) })] @@ -51,6 +54,9 @@ public partial interface IQnAMakerEndpointKeysRequestBody : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the host name of the QnA Maker endpoint", SerializedName = @"hostname", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/QnAMakerEndpointKeysRequestBody.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/QnAMakerEndpointKeysRequestBody.json.cs similarity index 92% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/QnAMakerEndpointKeysRequestBody.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/QnAMakerEndpointKeysRequestBody.json.cs index 43c33f16d348..2102b53f00c8 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/QnAMakerEndpointKeysRequestBody.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/QnAMakerEndpointKeysRequestBody.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class QnAMakerEndpointKeysRequestBody partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysRequestBody. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysRequestBody. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysRequestBody. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysRequestBody. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysRequestBody FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysRequestBody FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new QnAMakerEndpointKeysRequestBody(json) : null; } @@ -79,8 +79,8 @@ internal QnAMakerEndpointKeysRequestBody(Microsoft.Azure.PowerShell.Cmdlets.BotS { return; } - {_hostname = If( json?.PropertyT("hostname"), out var __jsonHostname) ? (string)__jsonHostname : (string)Hostname;} - {_authkey = If( json?.PropertyT("authkey"), out var __jsonAuthkey) ? (string)__jsonAuthkey : (string)Authkey;} + {_hostname = If( json?.PropertyT("hostname"), out var __jsonHostname) ? (string)__jsonHostname : (string)_hostname;} + {_authkey = If( json?.PropertyT("authkey"), out var __jsonAuthkey) ? (string)__jsonAuthkey : (string)_authkey;} AfterFromJson(json); } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/QnAMakerEndpointKeysResponse.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/QnAMakerEndpointKeysResponse.PowerShell.cs similarity index 67% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/QnAMakerEndpointKeysResponse.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/QnAMakerEndpointKeysResponse.PowerShell.cs index eb78a4a80b63..17d7eebd62c0 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/QnAMakerEndpointKeysResponse.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/QnAMakerEndpointKeysResponse.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class QnAMakerEndpointKeysResponse 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.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new QnAMakerEndpointKeysResponse(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.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new QnAMakerEndpointKeysResponse(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Pr /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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 QnAMakerEndpointKeysResponse(global::System.Collections.IDictionary con // actually deserialize if (content.Contains("PrimaryEndpointKey")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysResponseInternal)this).PrimaryEndpointKey = (string) content.GetValueForProperty("PrimaryEndpointKey",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysResponseInternal)this).PrimaryEndpointKey, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysResponseInternal)this).PrimaryEndpointKey = (string) content.GetValueForProperty("PrimaryEndpointKey",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysResponseInternal)this).PrimaryEndpointKey, global::System.Convert.ToString); } if (content.Contains("SecondaryEndpointKey")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysResponseInternal)this).SecondaryEndpointKey = (string) content.GetValueForProperty("SecondaryEndpointKey",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysResponseInternal)this).SecondaryEndpointKey, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysResponseInternal)this).SecondaryEndpointKey = (string) content.GetValueForProperty("SecondaryEndpointKey",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysResponseInternal)this).SecondaryEndpointKey, global::System.Convert.ToString); } if (content.Contains("InstalledVersion")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysResponseInternal)this).InstalledVersion = (string) content.GetValueForProperty("InstalledVersion",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysResponseInternal)this).InstalledVersion, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysResponseInternal)this).InstalledVersion = (string) content.GetValueForProperty("InstalledVersion",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysResponseInternal)this).InstalledVersion, global::System.Convert.ToString); } if (content.Contains("LastStableVersion")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysResponseInternal)this).LastStableVersion = (string) content.GetValueForProperty("LastStableVersion",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysResponseInternal)this).LastStableVersion, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysResponseInternal)this).LastStableVersion = (string) content.GetValueForProperty("LastStableVersion",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysResponseInternal)this).LastStableVersion, 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 QnAMakerEndpointKeysResponse(global::System.Management.Automation.PSObj // actually deserialize if (content.Contains("PrimaryEndpointKey")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysResponseInternal)this).PrimaryEndpointKey = (string) content.GetValueForProperty("PrimaryEndpointKey",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysResponseInternal)this).PrimaryEndpointKey, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysResponseInternal)this).PrimaryEndpointKey = (string) content.GetValueForProperty("PrimaryEndpointKey",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysResponseInternal)this).PrimaryEndpointKey, global::System.Convert.ToString); } if (content.Contains("SecondaryEndpointKey")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysResponseInternal)this).SecondaryEndpointKey = (string) content.GetValueForProperty("SecondaryEndpointKey",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysResponseInternal)this).SecondaryEndpointKey, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysResponseInternal)this).SecondaryEndpointKey = (string) content.GetValueForProperty("SecondaryEndpointKey",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysResponseInternal)this).SecondaryEndpointKey, global::System.Convert.ToString); } if (content.Contains("InstalledVersion")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysResponseInternal)this).InstalledVersion = (string) content.GetValueForProperty("InstalledVersion",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysResponseInternal)this).InstalledVersion, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysResponseInternal)this).InstalledVersion = (string) content.GetValueForProperty("InstalledVersion",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysResponseInternal)this).InstalledVersion, global::System.Convert.ToString); } if (content.Contains("LastStableVersion")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysResponseInternal)this).LastStableVersion = (string) content.GetValueForProperty("LastStableVersion",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysResponseInternal)this).LastStableVersion, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysResponseInternal)this).LastStableVersion = (string) content.GetValueForProperty("LastStableVersion",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysResponseInternal)this).LastStableVersion, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -159,6 +165,18 @@ internal QnAMakerEndpointKeysResponse(global::System.Management.Automation.PSObj /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.BotService.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(); + } } /// Schema for EndpointKeys generate/refresh operations. [System.ComponentModel.TypeConverter(typeof(QnAMakerEndpointKeysResponseTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/QnAMakerEndpointKeysResponse.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/QnAMakerEndpointKeysResponse.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/QnAMakerEndpointKeysResponse.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/QnAMakerEndpointKeysResponse.TypeConverter.cs index 7703ef044287..da8999bd4c89 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/QnAMakerEndpointKeysResponse.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/QnAMakerEndpointKeysResponse.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysResponse ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysResponse ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysResponse).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysResponse).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/QnAMakerEndpointKeysResponse.cs b/generated/BotService/BotService.Autorest/generated/api/Models/QnAMakerEndpointKeysResponse.cs similarity index 90% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/QnAMakerEndpointKeysResponse.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/QnAMakerEndpointKeysResponse.cs index 915cdaeca7ba..c74d6628b8ea 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/QnAMakerEndpointKeysResponse.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/QnAMakerEndpointKeysResponse.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// Schema for EndpointKeys generate/refresh operations. public partial class QnAMakerEndpointKeysResponse : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysResponse, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysResponseInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysResponse, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysResponseInternal { /// Backing field for property. @@ -55,6 +55,9 @@ public partial interface IQnAMakerEndpointKeysResponse : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Current version of runtime.", SerializedName = @"installedVersion", PossibleTypes = new [] { typeof(string) })] @@ -63,6 +66,9 @@ public partial interface IQnAMakerEndpointKeysResponse : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Latest version of runtime.", SerializedName = @"lastStableVersion", PossibleTypes = new [] { typeof(string) })] @@ -71,6 +77,9 @@ public partial interface IQnAMakerEndpointKeysResponse : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Primary Access Key.", SerializedName = @"primaryEndpointKey", PossibleTypes = new [] { typeof(string) })] @@ -79,6 +88,9 @@ public partial interface IQnAMakerEndpointKeysResponse : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Secondary Access Key.", SerializedName = @"secondaryEndpointKey", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/QnAMakerEndpointKeysResponse.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/QnAMakerEndpointKeysResponse.json.cs similarity index 93% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/QnAMakerEndpointKeysResponse.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/QnAMakerEndpointKeysResponse.json.cs index fbf3a061e3c6..3c86748bbc63 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/QnAMakerEndpointKeysResponse.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/QnAMakerEndpointKeysResponse.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class QnAMakerEndpointKeysResponse partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysResponse. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysResponse. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysResponse. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysResponse. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new QnAMakerEndpointKeysResponse(json) : null; } @@ -77,10 +77,10 @@ internal QnAMakerEndpointKeysResponse(Microsoft.Azure.PowerShell.Cmdlets.BotServ { return; } - {_primaryEndpointKey = If( json?.PropertyT("primaryEndpointKey"), out var __jsonPrimaryEndpointKey) ? (string)__jsonPrimaryEndpointKey : (string)PrimaryEndpointKey;} - {_secondaryEndpointKey = If( json?.PropertyT("secondaryEndpointKey"), out var __jsonSecondaryEndpointKey) ? (string)__jsonSecondaryEndpointKey : (string)SecondaryEndpointKey;} - {_installedVersion = If( json?.PropertyT("installedVersion"), out var __jsonInstalledVersion) ? (string)__jsonInstalledVersion : (string)InstalledVersion;} - {_lastStableVersion = If( json?.PropertyT("lastStableVersion"), out var __jsonLastStableVersion) ? (string)__jsonLastStableVersion : (string)LastStableVersion;} + {_primaryEndpointKey = If( json?.PropertyT("primaryEndpointKey"), out var __jsonPrimaryEndpointKey) ? (string)__jsonPrimaryEndpointKey : (string)_primaryEndpointKey;} + {_secondaryEndpointKey = If( json?.PropertyT("secondaryEndpointKey"), out var __jsonSecondaryEndpointKey) ? (string)__jsonSecondaryEndpointKey : (string)_secondaryEndpointKey;} + {_installedVersion = If( json?.PropertyT("installedVersion"), out var __jsonInstalledVersion) ? (string)__jsonInstalledVersion : (string)_installedVersion;} + {_lastStableVersion = If( json?.PropertyT("lastStableVersion"), out var __jsonLastStableVersion) ? (string)__jsonLastStableVersion : (string)_lastStableVersion;} AfterFromJson(json); } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Resource.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/Resource.PowerShell.cs similarity index 56% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Resource.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/Resource.PowerShell.cs index d3ee3ee3a02d..397569a736fd 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Resource.PowerShell.cs +++ b/generated/BotService/BotService.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class Resource 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.BotService.Models.Api20220615Preview.IResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new Resource(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Pr /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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. @@ -103,53 +111,53 @@ internal Resource(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Sku")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SkuTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.SkuTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ResourceTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Kind")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Kind?) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Kind.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Kind = (string) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Kind, global::System.Convert.ToString); } if (content.Contains("Etag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Etag, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Etag, global::System.Convert.ToString); } if (content.Contains("Zone")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Zone = (string[]) content.GetValueForProperty("Zone",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Zone, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Zone = (System.Collections.Generic.List) content.GetValueForProperty("Zone",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Zone, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("SkuName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).SkuName = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).SkuName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).SkuName, global::System.Convert.ToString); } if (content.Contains("SkuTier")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).SkuTier = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuTier?) content.GetValueForProperty("SkuTier",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).SkuTier, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuTier.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).SkuTier = (string) content.GetValueForProperty("SkuTier",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).SkuTier, 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,47 +172,47 @@ internal Resource(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Sku")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SkuTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.SkuTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ResourceTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Kind")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Kind?) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Kind.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Kind = (string) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Kind, global::System.Convert.ToString); } if (content.Contains("Etag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Etag, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Etag, global::System.Convert.ToString); } if (content.Contains("Zone")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Zone = (string[]) content.GetValueForProperty("Zone",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).Zone, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Zone = (System.Collections.Generic.List) content.GetValueForProperty("Zone",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).Zone, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("SkuName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).SkuName = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).SkuName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).SkuName, global::System.Convert.ToString); } if (content.Contains("SkuTier")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).SkuTier = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuTier?) content.GetValueForProperty("SkuTier",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal)this).SkuTier, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuTier.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).SkuTier = (string) content.GetValueForProperty("SkuTier",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal)this).SkuTier, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -213,6 +221,18 @@ internal Resource(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.BotService.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(); + } } /// Azure resource [System.ComponentModel.TypeConverter(typeof(ResourceTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Resource.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/Resource.TypeConverter.cs similarity index 97% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Resource.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/Resource.TypeConverter.cs index 589236b5a151..6e6ea37083dd 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Resource.TypeConverter.cs +++ b/generated/BotService/BotService.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IResource ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResource ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResource).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResource).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Resource.cs b/generated/BotService/BotService.Autorest/generated/api/Models/Resource.cs similarity index 68% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Resource.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/Resource.cs index c19c4a10940c..363918c70d39 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Resource.cs +++ b/generated/BotService/BotService.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// Azure resource public partial class Resource : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResource, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResource, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal { /// Backing field for property. @@ -28,11 +28,11 @@ public partial class Resource : public string Id { get => this._id; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Kind? _kind; + private string _kind; /// Required. Gets or sets the Kind of the resource. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Kind? Kind { get => this._kind; set => this._kind = value; } + public string Kind { get => this._kind; set => this._kind = value; } /// Backing field for property. private string _location; @@ -42,22 +42,22 @@ public partial class Resource : public string Location { get => this._location; set => this._location = value; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal.Id { get => this._id; set { {_id = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal.Id { get => this._id; set { {_id = value;} } } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal.Name { get => this._name; set { {_name = value;} } } /// Internal Acessors for Sku - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISku Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal.Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Sku()); set { {_sku = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISku Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal.Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Sku()); set { {_sku = value;} } } /// Internal Acessors for SkuTier - Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuTier? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal.SkuTier { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkuInternal)Sku).Tier; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkuInternal)Sku).Tier = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal.SkuTier { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkuInternal)Sku).Tier; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkuInternal)Sku).Tier = value; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal.Type { get => this._type; set { {_type = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal.Type { get => this._type; set { {_type = value;} } } /// Internal Acessors for Zone - string[] Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceInternal.Zone { get => this._zone; set { {_zone = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceInternal.Zone { get => this._zone; set { {_zone = value;} } } /// Backing field for property. private string _name; @@ -67,26 +67,26 @@ public partial class Resource : public string Name { get => this._name; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISku _sku; + private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISku _sku; /// Gets or sets the SKU of the resource. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISku Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Sku()); set => this._sku = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISku Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Sku()); set => this._sku = value; } /// The sku name [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName? SkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkuInternal)Sku).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkuInternal)Sku).Name = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName)""); } + public string SkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkuInternal)Sku).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkuInternal)Sku).Name = value ?? null; } /// Gets the sku tier. This is based on the SKU name. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuTier? SkuTier { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkuInternal)Sku).Tier; } + public string SkuTier { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkuInternal)Sku).Tier; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceTags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceTags _tag; /// Contains resource tags defined as key/value pairs. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ResourceTags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ResourceTags()); set => this._tag = value; } /// Backing field for property. private string _type; @@ -96,11 +96,11 @@ public partial class Resource : public string Type { get => this._type; } /// Backing field for property. - private string[] _zone; + private System.Collections.Generic.List _zone; /// Entity zones [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Owned)] - public string[] Zone { get => this._zone; } + public System.Collections.Generic.List Zone { get => this._zone; } /// Creates an new instance. public Resource() @@ -116,6 +116,9 @@ public partial interface IResource : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Entity Tag", SerializedName = @"etag", PossibleTypes = new [] { typeof(string) })] @@ -124,6 +127,9 @@ public partial interface IResource : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Specifies the resource ID.", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -132,14 +138,21 @@ public partial interface IResource : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Required. Gets or sets the Kind of the resource.", SerializedName = @"kind", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Kind) })] - Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Kind? Kind { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("sdk", "designer", "bot", "function", "azurebot")] + string Kind { get; set; } /// Specifies the location of the resource. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Specifies the location of the resource.", SerializedName = @"location", PossibleTypes = new [] { typeof(string) })] @@ -148,6 +161,9 @@ public partial interface IResource : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Specifies the name of the resource.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -156,30 +172,44 @@ public partial interface IResource : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The sku name", SerializedName = @"name", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName) })] - Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName? SkuName { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("F0", "S1")] + string SkuName { get; set; } /// Gets the sku tier. This is based on the SKU name. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Gets the sku tier. This is based on the SKU name.", SerializedName = @"tier", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuTier) })] - Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuTier? SkuTier { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("Free", "Standard")] + string SkuTier { get; } /// Contains resource tags defined as key/value pairs. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Contains resource tags defined as key/value pairs.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceTags) })] - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceTags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceTags) })] + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceTags Tag { get; set; } /// Specifies the type of the resource. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Specifies the type of the resource.", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -188,10 +218,13 @@ public partial interface IResource : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Entity zones", SerializedName = @"zones", PossibleTypes = new [] { typeof(string) })] - string[] Zone { get; } + System.Collections.Generic.List Zone { get; } } /// Azure resource @@ -203,23 +236,26 @@ internal partial interface IResourceInternal /// Specifies the resource ID. string Id { get; set; } /// Required. Gets or sets the Kind of the resource. - Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Kind? Kind { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("sdk", "designer", "bot", "function", "azurebot")] + string Kind { get; set; } /// Specifies the location of the resource. string Location { get; set; } /// Specifies the name of the resource. string Name { get; set; } /// Gets or sets the SKU of the resource. - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISku Sku { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISku Sku { get; set; } /// The sku name - Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName? SkuName { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("F0", "S1")] + string SkuName { get; set; } /// Gets the sku tier. This is based on the SKU name. - Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuTier? SkuTier { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("Free", "Standard")] + string SkuTier { get; set; } /// Contains resource tags defined as key/value pairs. - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceTags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceTags Tag { get; set; } /// Specifies the type of the resource. string Type { get; set; } /// Entity zones - string[] Zone { get; set; } + System.Collections.Generic.List Zone { get; set; } } } \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Resource.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/Resource.json.cs similarity index 87% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Resource.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/Resource.json.cs index 09c3f52f398e..c2f49aa151ab 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Resource.json.cs +++ b/generated/BotService/BotService.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -54,13 +54,11 @@ public partial class Resource partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResource. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResource. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResource. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResource. + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new Resource(json) : null; } @@ -77,15 +75,15 @@ internal Resource(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.Jso { return; } - {_sku = If( json?.PropertyT("sku"), out var __jsonSku) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Sku.FromJson(__jsonSku) : Sku;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)Location;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ResourceTags.FromJson(__jsonTags) : Tag;} - {_kind = If( json?.PropertyT("kind"), out var __jsonKind) ? (string)__jsonKind : (string)Kind;} - {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? (string)__jsonEtag : (string)Etag;} - {_zone = If( json?.PropertyT("zones"), out var __jsonZones) ? If( __jsonZones as Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Zone;} + {_sku = If( json?.PropertyT("sku"), out var __jsonSku) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Sku.FromJson(__jsonSku) : _sku;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)_location;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ResourceTags.FromJson(__jsonTags) : _tag;} + {_kind = If( json?.PropertyT("kind"), out var __jsonKind) ? (string)__jsonKind : (string)_kind;} + {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? (string)__jsonEtag : (string)_etag;} + {_zone = If( json?.PropertyT("zones"), out var __jsonZones) ? If( __jsonZones as Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _zone;} AfterFromJson(json); } @@ -109,23 +107,23 @@ public Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode ToJso return container; } AddIf( null != this._sku ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) this._sku.ToJson(null,serializationMode) : null, "sku" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } AddIf( null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._location.ToString()) : null, "location" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); } AddIf( null != this._tag ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) this._tag.ToJson(null,serializationMode) : null, "tags" ,container.Add ); AddIf( null != (((object)this._kind)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._kind.ToString()) : null, "kind" ,container.Add ); AddIf( null != (((object)this._etag)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._etag.ToString()) : null, "etag" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)) { if (null != this._zone) { diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ResourceTags.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/ResourceTags.PowerShell.cs similarity index 81% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ResourceTags.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/ResourceTags.PowerShell.cs index 7af056b1b02b..95d1e072be3e 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ResourceTags.PowerShell.cs +++ b/generated/BotService/BotService.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class ResourceTags 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.BotService.Models.Api20220615Preview.IResourceTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ResourceTags(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Pr /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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,7 +115,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. @@ -129,6 +137,18 @@ internal ResourceTags(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.BotService.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(); + } } /// Contains resource tags defined as key/value pairs. [System.ComponentModel.TypeConverter(typeof(ResourceTagsTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ResourceTags.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/ResourceTags.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ResourceTags.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/ResourceTags.TypeConverter.cs index fded77773e6c..d10c0bd233a2 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ResourceTags.TypeConverter.cs +++ b/generated/BotService/BotService.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IResourceTags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceTags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceTags).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ResourceTags.cs b/generated/BotService/BotService.Autorest/generated/api/Models/ResourceTags.cs similarity index 79% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ResourceTags.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/ResourceTags.cs index 9058d73abaec..202df424a4c1 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ResourceTags.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/ResourceTags.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// Contains resource tags defined as key/value pairs. public partial class ResourceTags : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceTags, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceTagsInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceTags, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceTagsInternal { /// Creates an new instance. diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ResourceTags.dictionary.cs b/generated/BotService/BotService.Autorest/generated/api/Models/ResourceTags.dictionary.cs similarity index 95% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ResourceTags.dictionary.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/ResourceTags.dictionary.cs index ebcb66571b82..9fcc024b004e 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ResourceTags.dictionary.cs +++ b/generated/BotService/BotService.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.ResourceTags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ResourceTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ResourceTags.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/ResourceTags.json.cs similarity index 95% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ResourceTags.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/ResourceTags.json.cs index 38f3b8e86377..95614bb95343 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ResourceTags.json.cs +++ b/generated/BotService/BotService.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ResourceTags partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceTags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceTags. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceTags. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceTags. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new ResourceTags(json) : null; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProvider.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/ServiceProvider.PowerShell.cs similarity index 60% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProvider.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/ServiceProvider.PowerShell.cs index a5b95e6af02b..1cac11a7e83b 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProvider.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/ServiceProvider.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class ServiceProvider 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.BotService.Models.Api20220615Preview.IServiceProvider DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProvider DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ServiceProvider(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.BotService.Models.Api20220615Preview.IServiceProvider DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProvider DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ServiceProvider(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Pr /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProvider FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProvider FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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. @@ -103,37 +111,37 @@ internal ServiceProvider(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ServiceProviderPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ServiceProviderPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("DevPortalUrl")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderInternal)this).DevPortalUrl = (string) content.GetValueForProperty("DevPortalUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderInternal)this).DevPortalUrl, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderInternal)this).DevPortalUrl = (string) content.GetValueForProperty("DevPortalUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderInternal)this).DevPortalUrl, global::System.Convert.ToString); } if (content.Contains("IconUrl")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderInternal)this).IconUrl = (string) content.GetValueForProperty("IconUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderInternal)this).IconUrl, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderInternal)this).IconUrl = (string) content.GetValueForProperty("IconUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderInternal)this).IconUrl, global::System.Convert.ToString); } if (content.Contains("Parameter")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderInternal)this).Parameter = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameter[]) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderInternal)this).Parameter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ServiceProviderParameterTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderInternal)this).Parameter = (System.Collections.Generic.List) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderInternal)this).Parameter, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ServiceProviderParameterTypeConverter.ConvertFrom)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -148,31 +156,31 @@ internal ServiceProvider(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ServiceProviderPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ServiceProviderPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("DevPortalUrl")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderInternal)this).DevPortalUrl = (string) content.GetValueForProperty("DevPortalUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderInternal)this).DevPortalUrl, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderInternal)this).DevPortalUrl = (string) content.GetValueForProperty("DevPortalUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderInternal)this).DevPortalUrl, global::System.Convert.ToString); } if (content.Contains("IconUrl")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderInternal)this).IconUrl = (string) content.GetValueForProperty("IconUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderInternal)this).IconUrl, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderInternal)this).IconUrl = (string) content.GetValueForProperty("IconUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderInternal)this).IconUrl, global::System.Convert.ToString); } if (content.Contains("Parameter")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderInternal)this).Parameter = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameter[]) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderInternal)this).Parameter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ServiceProviderParameterTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderInternal)this).Parameter = (System.Collections.Generic.List) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderInternal)this).Parameter, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ServiceProviderParameterTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } @@ -181,6 +189,18 @@ internal ServiceProvider(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.BotService.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(); + } } /// Service Provider Definition [System.ComponentModel.TypeConverter(typeof(ServiceProviderTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProvider.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/ServiceProvider.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProvider.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/ServiceProvider.TypeConverter.cs index 318b95202fa0..2e8b19f0ee3a 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProvider.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/ServiceProvider.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IServiceProvider ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProvider ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProvider).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProvider).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProvider.cs b/generated/BotService/BotService.Autorest/generated/api/Models/ServiceProvider.cs similarity index 60% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProvider.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/ServiceProvider.cs index 7ba633573361..9c1fee157801 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProvider.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/ServiceProvider.cs @@ -3,64 +3,64 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// Service Provider Definition public partial class ServiceProvider : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProvider, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProvider, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderInternal { /// Display Name of the Service Provider [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string DevPortalUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderPropertiesInternal)Property).DevPortalUrl; } + public string DevPortalUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderPropertiesInternal)Property).DevPortalUrl; } /// Display Name of the Service Provider [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderPropertiesInternal)Property).DisplayName; } + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderPropertiesInternal)Property).DisplayName; } /// Display Name of the Service Provider [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string IconUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderPropertiesInternal)Property).IconUrl; } + public string IconUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderPropertiesInternal)Property).IconUrl; } /// Id for Service Provider [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderPropertiesInternal)Property).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderPropertiesInternal)Property).Id; } /// Internal Acessors for DevPortalUrl - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderInternal.DevPortalUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderPropertiesInternal)Property).DevPortalUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderPropertiesInternal)Property).DevPortalUrl = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderInternal.DevPortalUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderPropertiesInternal)Property).DevPortalUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderPropertiesInternal)Property).DevPortalUrl = value; } /// Internal Acessors for DisplayName - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderInternal.DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderPropertiesInternal)Property).DisplayName = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderInternal.DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderPropertiesInternal)Property).DisplayName = value; } /// Internal Acessors for IconUrl - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderInternal.IconUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderPropertiesInternal)Property).IconUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderPropertiesInternal)Property).IconUrl = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderInternal.IconUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderPropertiesInternal)Property).IconUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderPropertiesInternal)Property).IconUrl = value; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderPropertiesInternal)Property).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderPropertiesInternal)Property).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderPropertiesInternal)Property).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderPropertiesInternal)Property).Id = value; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderPropertiesInternal)Property).ServiceProviderName; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderPropertiesInternal)Property).ServiceProviderName = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderPropertiesInternal)Property).ServiceProviderName; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderPropertiesInternal)Property).ServiceProviderName = value; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderProperties Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ServiceProviderProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderProperties Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ServiceProviderProperties()); set { {_property = value;} } } /// Display Name of the Service Provider [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderPropertiesInternal)Property).ServiceProviderName; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderPropertiesInternal)Property).ServiceProviderName; } /// The list of parameters for the Service Provider [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameter[] Parameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderPropertiesInternal)Property).Parameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderPropertiesInternal)Property).Parameter = value ?? null /* arrayOf */; } + public System.Collections.Generic.List Parameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderPropertiesInternal)Property).Parameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderPropertiesInternal)Property).Parameter = value ?? null /* arrayOf */; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderProperties _property; /// The Properties of a Service Provider Object [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ServiceProviderProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ServiceProviderProperties()); set => this._property = value; } /// Creates an new instance. public ServiceProvider() @@ -76,6 +76,9 @@ public partial interface IServiceProvider : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Display Name of the Service Provider", SerializedName = @"devPortalUrl", PossibleTypes = new [] { typeof(string) })] @@ -84,6 +87,9 @@ public partial interface IServiceProvider : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Display Name of the Service Provider", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -92,6 +98,9 @@ public partial interface IServiceProvider : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Display Name of the Service Provider", SerializedName = @"iconUrl", PossibleTypes = new [] { typeof(string) })] @@ -100,6 +109,9 @@ public partial interface IServiceProvider : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Id for Service Provider", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -108,6 +120,9 @@ public partial interface IServiceProvider : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Display Name of the Service Provider", SerializedName = @"serviceProviderName", PossibleTypes = new [] { typeof(string) })] @@ -116,10 +131,13 @@ public partial interface IServiceProvider : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of parameters for the Service Provider", SerializedName = @"parameters", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameter) })] - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameter[] Parameter { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameter) })] + System.Collections.Generic.List Parameter { get; set; } } /// Service Provider Definition @@ -137,9 +155,9 @@ internal partial interface IServiceProviderInternal /// Display Name of the Service Provider string Name { get; set; } /// The list of parameters for the Service Provider - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameter[] Parameter { get; set; } + System.Collections.Generic.List Parameter { get; set; } /// The Properties of a Service Provider Object - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderProperties Property { get; set; } } } \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProvider.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/ServiceProvider.json.cs similarity index 93% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProvider.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/ServiceProvider.json.cs index 77f00608fb2a..80f15dd0bb3f 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProvider.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/ServiceProvider.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ServiceProvider partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProvider. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProvider. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProvider. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProvider. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProvider FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProvider FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new ServiceProvider(json) : null; } @@ -77,7 +77,7 @@ internal ServiceProvider(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.J { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ServiceProviderProperties.FromJson(__jsonProperties) : Property;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ServiceProviderProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProviderParameter.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/ServiceProviderParameter.PowerShell.cs similarity index 56% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProviderParameter.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/ServiceProviderParameter.PowerShell.cs index 0d76d113d812..2b28a158216d 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProviderParameter.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/ServiceProviderParameter.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class ServiceProviderParameter 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.BotService.Models.Api20220615Preview.IServiceProviderParameter DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameter DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ServiceProviderParameter(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.BotService.Models.Api20220615Preview.IServiceProviderParameter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ServiceProviderParameter(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Pr /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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 +111,45 @@ internal ServiceProviderParameter(global::System.Collections.IDictionary content // actually deserialize if (content.Contains("Metadata")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterInternal)this).Metadata = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterMetadata) content.GetValueForProperty("Metadata",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterInternal)this).Metadata, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ServiceProviderParameterMetadataTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterInternal)this).Metadata = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterMetadata) content.GetValueForProperty("Metadata",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterInternal)this).Metadata, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ServiceProviderParameterMetadataTypeConverter.ConvertFrom); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterInternal)this).Description, global::System.Convert.ToString); } if (content.Contains("HelpUrl")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterInternal)this).HelpUrl = (string) content.GetValueForProperty("HelpUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterInternal)this).HelpUrl, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterInternal)this).HelpUrl = (string) content.GetValueForProperty("HelpUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterInternal)this).HelpUrl, global::System.Convert.ToString); } if (content.Contains("Default")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterInternal)this).Default = (string) content.GetValueForProperty("Default",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterInternal)this).Default, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterInternal)this).Default = (string) content.GetValueForProperty("Default",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterInternal)this).Default, global::System.Convert.ToString); } if (content.Contains("MetadataConstraint")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterInternal)this).MetadataConstraint = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterMetadataConstraints) content.GetValueForProperty("MetadataConstraint",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterInternal)this).MetadataConstraint, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ServiceProviderParameterMetadataConstraintsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterInternal)this).MetadataConstraint = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterMetadataConstraints) content.GetValueForProperty("MetadataConstraint",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterInternal)this).MetadataConstraint, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ServiceProviderParameterMetadataConstraintsTypeConverter.ConvertFrom); } if (content.Contains("ConstraintRequired")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterInternal)this).ConstraintRequired = (bool?) content.GetValueForProperty("ConstraintRequired",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterInternal)this).ConstraintRequired, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterInternal)this).ConstraintRequired = (bool?) content.GetValueForProperty("ConstraintRequired",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterInternal)this).ConstraintRequired, (__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. @@ -158,39 +164,39 @@ internal ServiceProviderParameter(global::System.Management.Automation.PSObject // actually deserialize if (content.Contains("Metadata")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterInternal)this).Metadata = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterMetadata) content.GetValueForProperty("Metadata",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterInternal)this).Metadata, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ServiceProviderParameterMetadataTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterInternal)this).Metadata = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterMetadata) content.GetValueForProperty("Metadata",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterInternal)this).Metadata, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ServiceProviderParameterMetadataTypeConverter.ConvertFrom); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterInternal)this).Description, global::System.Convert.ToString); } if (content.Contains("HelpUrl")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterInternal)this).HelpUrl = (string) content.GetValueForProperty("HelpUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterInternal)this).HelpUrl, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterInternal)this).HelpUrl = (string) content.GetValueForProperty("HelpUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterInternal)this).HelpUrl, global::System.Convert.ToString); } if (content.Contains("Default")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterInternal)this).Default = (string) content.GetValueForProperty("Default",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterInternal)this).Default, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterInternal)this).Default = (string) content.GetValueForProperty("Default",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterInternal)this).Default, global::System.Convert.ToString); } if (content.Contains("MetadataConstraint")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterInternal)this).MetadataConstraint = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterMetadataConstraints) content.GetValueForProperty("MetadataConstraint",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterInternal)this).MetadataConstraint, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ServiceProviderParameterMetadataConstraintsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterInternal)this).MetadataConstraint = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterMetadataConstraints) content.GetValueForProperty("MetadataConstraint",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterInternal)this).MetadataConstraint, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ServiceProviderParameterMetadataConstraintsTypeConverter.ConvertFrom); } if (content.Contains("ConstraintRequired")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterInternal)this).ConstraintRequired = (bool?) content.GetValueForProperty("ConstraintRequired",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterInternal)this).ConstraintRequired, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterInternal)this).ConstraintRequired = (bool?) content.GetValueForProperty("ConstraintRequired",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterInternal)this).ConstraintRequired, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializePSObject(content); } @@ -199,6 +205,18 @@ internal ServiceProviderParameter(global::System.Management.Automation.PSObject /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.BotService.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(); + } } /// Extra Parameters specific to each Service Provider [System.ComponentModel.TypeConverter(typeof(ServiceProviderParameterTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProviderParameter.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/ServiceProviderParameter.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProviderParameter.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/ServiceProviderParameter.TypeConverter.cs index aeb1374a26fa..f2e5218170c1 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProviderParameter.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/ServiceProviderParameter.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IServiceProviderParameter ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameter ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameter).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameter).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProviderParameter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/ServiceProviderParameter.cs similarity index 71% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProviderParameter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/ServiceProviderParameter.cs index 82bca08635a1..3e388b84e585 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProviderParameter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/ServiceProviderParameter.cs @@ -3,19 +3,19 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// Extra Parameters specific to each Service Provider public partial class ServiceProviderParameter : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameter, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameter, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterInternal { /// Whether required the constraints of the bot meta data. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public bool? ConstraintRequired { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterMetadataInternal)Metadata).ConstraintRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterMetadataInternal)Metadata).ConstraintRequired = value ?? default(bool); } + public bool? ConstraintRequired { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterMetadataInternal)Metadata).ConstraintRequired; } /// Backing field for property. private string _default; @@ -46,35 +46,38 @@ public partial class ServiceProviderParameter : public string HelpUrl { get => this._helpUrl; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterMetadata _metadata; + private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterMetadata _metadata; /// Meta data for the Service Provider [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterMetadata Metadata { get => (this._metadata = this._metadata ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ServiceProviderParameterMetadata()); } + internal Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterMetadata Metadata { get => (this._metadata = this._metadata ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ServiceProviderParameterMetadata()); } + + /// Internal Acessors for ConstraintRequired + bool? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterInternal.ConstraintRequired { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterMetadataInternal)Metadata).ConstraintRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterMetadataInternal)Metadata).ConstraintRequired = value; } /// Internal Acessors for Default - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterInternal.Default { get => this._default; set { {_default = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterInternal.Default { get => this._default; set { {_default = value;} } } /// Internal Acessors for Description - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterInternal.Description { get => this._description; set { {_description = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterInternal.Description { get => this._description; set { {_description = value;} } } /// Internal Acessors for DisplayName - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterInternal.DisplayName { get => this._displayName; set { {_displayName = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterInternal.DisplayName { get => this._displayName; set { {_displayName = value;} } } /// Internal Acessors for HelpUrl - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterInternal.HelpUrl { get => this._helpUrl; set { {_helpUrl = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterInternal.HelpUrl { get => this._helpUrl; set { {_helpUrl = value;} } } /// Internal Acessors for Metadata - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterMetadata Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterInternal.Metadata { get => (this._metadata = this._metadata ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ServiceProviderParameterMetadata()); set { {_metadata = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterMetadata Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterInternal.Metadata { get => (this._metadata = this._metadata ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ServiceProviderParameterMetadata()); set { {_metadata = value;} } } /// Internal Acessors for MetadataConstraint - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterMetadataConstraints Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterInternal.MetadataConstraint { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterMetadataInternal)Metadata).Constraint; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterMetadataInternal)Metadata).Constraint = value; } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterMetadataConstraints Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterInternal.MetadataConstraint { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterMetadataInternal)Metadata).Constraint; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterMetadataInternal)Metadata).Constraint = value; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterInternal.Name { get => this._name; set { {_name = value;} } } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterInternal.Type { get => this._type; set { {_type = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterInternal.Type { get => this._type; set { {_type = value;} } } /// Backing field for property. private string _name; @@ -103,15 +106,21 @@ public partial interface IServiceProviderParameter : /// Whether required the constraints of the bot meta data. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Whether required the constraints of the bot meta data.", SerializedName = @"required", PossibleTypes = new [] { typeof(bool) })] - bool? ConstraintRequired { get; set; } + bool? ConstraintRequired { get; } /// Default Name for the Service Provider [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Default Name for the Service Provider", SerializedName = @"default", PossibleTypes = new [] { typeof(string) })] @@ -120,6 +129,9 @@ public partial interface IServiceProviderParameter : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Description of the Service Provider", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -128,6 +140,9 @@ public partial interface IServiceProviderParameter : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Display Name of the Service Provider", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -136,6 +151,9 @@ public partial interface IServiceProviderParameter : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Help Url for the Service Provider", SerializedName = @"helpUrl", PossibleTypes = new [] { typeof(string) })] @@ -144,6 +162,9 @@ public partial interface IServiceProviderParameter : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Name of the Service Provider", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -152,6 +173,9 @@ public partial interface IServiceProviderParameter : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Type of the Service Provider", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -173,9 +197,9 @@ internal partial interface IServiceProviderParameterInternal /// Help Url for the Service Provider string HelpUrl { get; set; } /// Meta data for the Service Provider - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterMetadata Metadata { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterMetadata Metadata { get; set; } /// the constraints of the bot meta data. - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterMetadataConstraints MetadataConstraint { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterMetadataConstraints MetadataConstraint { get; set; } /// Name of the Service Provider string Name { get; set; } /// Type of the Service Provider diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProviderParameter.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/ServiceProviderParameter.json.cs similarity index 88% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProviderParameter.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/ServiceProviderParameter.json.cs index 51b8f6305f3b..564f99a1b897 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProviderParameter.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/ServiceProviderParameter.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ServiceProviderParameter partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameter. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameter. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameter. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameter. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameter FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameter FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new ServiceProviderParameter(json) : null; } @@ -77,13 +77,13 @@ internal ServiceProviderParameter(Microsoft.Azure.PowerShell.Cmdlets.BotService. { return; } - {_metadata = If( json?.PropertyT("metadata"), out var __jsonMetadata) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ServiceProviderParameterMetadata.FromJson(__jsonMetadata) : Metadata;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} - {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} - {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} - {_helpUrl = If( json?.PropertyT("helpUrl"), out var __jsonHelpUrl) ? (string)__jsonHelpUrl : (string)HelpUrl;} - {_default = If( json?.PropertyT("default"), out var __jsonDefault) ? (string)__jsonDefault : (string)Default;} + {_metadata = If( json?.PropertyT("metadata"), out var __jsonMetadata) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ServiceProviderParameterMetadata.FromJson(__jsonMetadata) : _metadata;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)_displayName;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)_description;} + {_helpUrl = If( json?.PropertyT("helpUrl"), out var __jsonHelpUrl) ? (string)__jsonHelpUrl : (string)_helpUrl;} + {_default = If( json?.PropertyT("default"), out var __jsonDefault) ? (string)__jsonDefault : (string)_default;} AfterFromJson(json); } @@ -106,31 +106,31 @@ public Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode ToJso { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._metadata ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) this._metadata.ToJson(null,serializationMode) : null, "metadata" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._displayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._displayName.ToString()) : null, "displayName" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._helpUrl)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._helpUrl.ToString()) : null, "helpUrl" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._default)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._default.ToString()) : null, "default" ,container.Add ); } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProviderParameterMetadata.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/ServiceProviderParameterMetadata.PowerShell.cs similarity index 69% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProviderParameterMetadata.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/ServiceProviderParameterMetadata.PowerShell.cs index b3bbb68fe002..68ab7e29bfc1 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProviderParameterMetadata.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/ServiceProviderParameterMetadata.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class ServiceProviderParameterMetadata 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.BotService.Models.Api20220615Preview.IServiceProviderParameterMetadata DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterMetadata DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ServiceProviderParameterMetadata(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.BotService.Models.Api20220615Preview.IServiceProviderParameterMetadata DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterMetadata DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ServiceProviderParameterMetadata(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Pr /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterMetadata FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterMetadata FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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 +111,17 @@ internal ServiceProviderParameterMetadata(global::System.Collections.IDictionary // actually deserialize if (content.Contains("Constraint")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterMetadataInternal)this).Constraint = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterMetadataConstraints) content.GetValueForProperty("Constraint",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterMetadataInternal)this).Constraint, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ServiceProviderParameterMetadataConstraintsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterMetadataInternal)this).Constraint = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterMetadataConstraints) content.GetValueForProperty("Constraint",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterMetadataInternal)this).Constraint, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ServiceProviderParameterMetadataConstraintsTypeConverter.ConvertFrom); } if (content.Contains("ConstraintRequired")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterMetadataInternal)this).ConstraintRequired = (bool?) content.GetValueForProperty("ConstraintRequired",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterMetadataInternal)this).ConstraintRequired, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterMetadataInternal)this).ConstraintRequired = (bool?) content.GetValueForProperty("ConstraintRequired",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterMetadataInternal)this).ConstraintRequired, (__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. @@ -130,11 +136,11 @@ internal ServiceProviderParameterMetadata(global::System.Management.Automation.P // actually deserialize if (content.Contains("Constraint")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterMetadataInternal)this).Constraint = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterMetadataConstraints) content.GetValueForProperty("Constraint",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterMetadataInternal)this).Constraint, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ServiceProviderParameterMetadataConstraintsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterMetadataInternal)this).Constraint = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterMetadataConstraints) content.GetValueForProperty("Constraint",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterMetadataInternal)this).Constraint, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ServiceProviderParameterMetadataConstraintsTypeConverter.ConvertFrom); } if (content.Contains("ConstraintRequired")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterMetadataInternal)this).ConstraintRequired = (bool?) content.GetValueForProperty("ConstraintRequired",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterMetadataInternal)this).ConstraintRequired, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterMetadataInternal)this).ConstraintRequired = (bool?) content.GetValueForProperty("ConstraintRequired",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterMetadataInternal)this).ConstraintRequired, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializePSObject(content); } @@ -143,6 +149,18 @@ internal ServiceProviderParameterMetadata(global::System.Management.Automation.P /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.BotService.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(); + } } /// Meta data for the Service Provider [System.ComponentModel.TypeConverter(typeof(ServiceProviderParameterMetadataTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProviderParameterMetadata.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/ServiceProviderParameterMetadata.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProviderParameterMetadata.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/ServiceProviderParameterMetadata.TypeConverter.cs index 0ceee8a12c6f..67f68d6b77f1 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProviderParameterMetadata.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/ServiceProviderParameterMetadata.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IServiceProviderParameterMetadata ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterMetadata ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterMetadata).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterMetadata).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProviderParameterMetadata.cs b/generated/BotService/BotService.Autorest/generated/api/Models/ServiceProviderParameterMetadata.cs similarity index 60% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProviderParameterMetadata.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/ServiceProviderParameterMetadata.cs index 8f4bbb8b61cc..d9fe3194ebe4 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProviderParameterMetadata.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/ServiceProviderParameterMetadata.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// Meta data for the Service Provider public partial class ServiceProviderParameterMetadata : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterMetadata, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterMetadataInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterMetadata, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterMetadataInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterMetadataConstraints _constraint; + private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterMetadataConstraints _constraint; /// the constraints of the bot meta data. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterMetadataConstraints Constraint { get => (this._constraint = this._constraint ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ServiceProviderParameterMetadataConstraints()); set => this._constraint = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterMetadataConstraints Constraint { get => (this._constraint = this._constraint ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ServiceProviderParameterMetadataConstraints()); set => this._constraint = value; } /// Whether required the constraints of the bot meta data. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public bool? ConstraintRequired { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterMetadataConstraintsInternal)Constraint).Required; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterMetadataConstraintsInternal)Constraint).Required = value ?? default(bool); } + public bool? ConstraintRequired { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterMetadataConstraintsInternal)Constraint).Required; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterMetadataConstraintsInternal)Constraint).Required = value ?? default(bool); } /// Internal Acessors for Constraint - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterMetadataConstraints Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterMetadataInternal.Constraint { get => (this._constraint = this._constraint ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ServiceProviderParameterMetadataConstraints()); set { {_constraint = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterMetadataConstraints Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterMetadataInternal.Constraint { get => (this._constraint = this._constraint ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ServiceProviderParameterMetadataConstraints()); set { {_constraint = value;} } } /// Creates an new instance. public ServiceProviderParameterMetadata() @@ -41,6 +41,9 @@ public partial interface IServiceProviderParameterMetadata : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Whether required the constraints of the bot meta data.", SerializedName = @"required", PossibleTypes = new [] { typeof(bool) })] @@ -52,7 +55,7 @@ internal partial interface IServiceProviderParameterMetadataInternal { /// the constraints of the bot meta data. - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterMetadataConstraints Constraint { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterMetadataConstraints Constraint { get; set; } /// Whether required the constraints of the bot meta data. bool? ConstraintRequired { get; set; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProviderParameterMetadata.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/ServiceProviderParameterMetadata.json.cs similarity index 92% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProviderParameterMetadata.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/ServiceProviderParameterMetadata.json.cs index 45626aa08a98..054911475ebd 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProviderParameterMetadata.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/ServiceProviderParameterMetadata.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ServiceProviderParameterMetadata partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterMetadata. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterMetadata. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterMetadata. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterMetadata. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterMetadata FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterMetadata FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new ServiceProviderParameterMetadata(json) : null; } @@ -77,7 +77,7 @@ internal ServiceProviderParameterMetadata(Microsoft.Azure.PowerShell.Cmdlets.Bot { return; } - {_constraint = If( json?.PropertyT("constraints"), out var __jsonConstraints) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ServiceProviderParameterMetadataConstraints.FromJson(__jsonConstraints) : Constraint;} + {_constraint = If( json?.PropertyT("constraints"), out var __jsonConstraints) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ServiceProviderParameterMetadataConstraints.FromJson(__jsonConstraints) : _constraint;} AfterFromJson(json); } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProviderParameterMetadataConstraints.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/ServiceProviderParameterMetadataConstraints.PowerShell.cs similarity index 75% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProviderParameterMetadataConstraints.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/ServiceProviderParameterMetadataConstraints.PowerShell.cs index 6e8fc0c67478..e0283bccb88c 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProviderParameterMetadataConstraints.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/ServiceProviderParameterMetadataConstraints.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class ServiceProviderParameterMetadataConstraints 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.BotService.Models.Api20220615Preview.IServiceProviderParameterMetadataConstraints DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterMetadataConstraints DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ServiceProviderParameterMetadataConstraints(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.BotService.Models.Api20220615Preview.IServiceProviderParameterMetadataConstraints DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterMetadataConstraints DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ServiceProviderParameterMetadataConstraints(content); } @@ -90,10 +98,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Pr /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterMetadataConstraints FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterMetadataConstraints FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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,13 +116,13 @@ internal ServiceProviderParameterMetadataConstraints(global::System.Collections. // actually deserialize if (content.Contains("Required")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterMetadataConstraintsInternal)this).Required = (bool?) content.GetValueForProperty("Required",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterMetadataConstraintsInternal)this).Required, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterMetadataConstraintsInternal)this).Required = (bool?) content.GetValueForProperty("Required",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterMetadataConstraintsInternal)this).Required, (__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. @@ -129,7 +137,7 @@ internal ServiceProviderParameterMetadataConstraints(global::System.Management.A // actually deserialize if (content.Contains("Required")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterMetadataConstraintsInternal)this).Required = (bool?) content.GetValueForProperty("Required",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterMetadataConstraintsInternal)this).Required, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterMetadataConstraintsInternal)this).Required = (bool?) content.GetValueForProperty("Required",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterMetadataConstraintsInternal)this).Required, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializePSObject(content); } @@ -138,6 +146,18 @@ internal ServiceProviderParameterMetadataConstraints(global::System.Management.A /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.BotService.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 constraints of the bot meta data. [System.ComponentModel.TypeConverter(typeof(ServiceProviderParameterMetadataConstraintsTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProviderParameterMetadataConstraints.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/ServiceProviderParameterMetadataConstraints.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProviderParameterMetadataConstraints.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/ServiceProviderParameterMetadataConstraints.TypeConverter.cs index b6d84c7d7b83..f2dde57578f0 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProviderParameterMetadataConstraints.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/ServiceProviderParameterMetadataConstraints.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IServiceProviderParameterMetadataConstraints ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterMetadataConstraints ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterMetadataConstraints).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterMetadataConstraints).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProviderParameterMetadataConstraints.cs b/generated/BotService/BotService.Autorest/generated/api/Models/ServiceProviderParameterMetadataConstraints.cs similarity index 85% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProviderParameterMetadataConstraints.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/ServiceProviderParameterMetadataConstraints.cs index dcd5473ed5d8..ab4e64dde8a5 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProviderParameterMetadataConstraints.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/ServiceProviderParameterMetadataConstraints.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// the constraints of the bot meta data. public partial class ServiceProviderParameterMetadataConstraints : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterMetadataConstraints, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterMetadataConstraintsInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterMetadataConstraints, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterMetadataConstraintsInternal { /// Backing field for property. @@ -36,6 +36,9 @@ public partial interface IServiceProviderParameterMetadataConstraints : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Whether required the constraints of the bot meta data.", SerializedName = @"required", PossibleTypes = new [] { typeof(bool) })] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProviderParameterMetadataConstraints.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/ServiceProviderParameterMetadataConstraints.json.cs similarity index 93% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProviderParameterMetadataConstraints.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/ServiceProviderParameterMetadataConstraints.json.cs index c7457f31d55d..8c50686cf8ac 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProviderParameterMetadataConstraints.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/ServiceProviderParameterMetadataConstraints.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ServiceProviderParameterMetadataConstraints partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterMetadataConstraints. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterMetadataConstraints. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterMetadataConstraints. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterMetadataConstraints. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameterMetadataConstraints FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameterMetadataConstraints FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new ServiceProviderParameterMetadataConstraints(json) : null; } @@ -77,7 +77,7 @@ internal ServiceProviderParameterMetadataConstraints(Microsoft.Azure.PowerShell. { return; } - {_required = If( json?.PropertyT("required"), out var __jsonRequired) ? (bool?)__jsonRequired : Required;} + {_required = If( json?.PropertyT("required"), out var __jsonRequired) ? (bool?)__jsonRequired : _required;} AfterFromJson(json); } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProviderProperties.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/ServiceProviderProperties.PowerShell.cs similarity index 61% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProviderProperties.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/ServiceProviderProperties.PowerShell.cs index 913089227b15..c480b2a9de0d 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProviderProperties.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/ServiceProviderProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class ServiceProviderProperties 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.BotService.Models.Api20220615Preview.IServiceProviderProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ServiceProviderProperties(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.BotService.Models.Api20220615Preview.IServiceProviderProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ServiceProviderProperties(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Pr /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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 +111,33 @@ internal ServiceProviderProperties(global::System.Collections.IDictionary conten // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderPropertiesInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderPropertiesInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderPropertiesInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderPropertiesInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderPropertiesInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderPropertiesInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("ServiceProviderName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderPropertiesInternal)this).ServiceProviderName = (string) content.GetValueForProperty("ServiceProviderName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderPropertiesInternal)this).ServiceProviderName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderPropertiesInternal)this).ServiceProviderName = (string) content.GetValueForProperty("ServiceProviderName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderPropertiesInternal)this).ServiceProviderName, global::System.Convert.ToString); } if (content.Contains("DevPortalUrl")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderPropertiesInternal)this).DevPortalUrl = (string) content.GetValueForProperty("DevPortalUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderPropertiesInternal)this).DevPortalUrl, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderPropertiesInternal)this).DevPortalUrl = (string) content.GetValueForProperty("DevPortalUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderPropertiesInternal)this).DevPortalUrl, global::System.Convert.ToString); } if (content.Contains("IconUrl")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderPropertiesInternal)this).IconUrl = (string) content.GetValueForProperty("IconUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderPropertiesInternal)this).IconUrl, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderPropertiesInternal)this).IconUrl = (string) content.GetValueForProperty("IconUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderPropertiesInternal)this).IconUrl, global::System.Convert.ToString); } if (content.Contains("Parameter")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderPropertiesInternal)this).Parameter = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameter[]) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderPropertiesInternal)this).Parameter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ServiceProviderParameterTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderPropertiesInternal)this).Parameter = (System.Collections.Generic.List) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderPropertiesInternal)this).Parameter, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ServiceProviderParameterTypeConverter.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. @@ -146,27 +152,27 @@ internal ServiceProviderProperties(global::System.Management.Automation.PSObject // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderPropertiesInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderPropertiesInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderPropertiesInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderPropertiesInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderPropertiesInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderPropertiesInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("ServiceProviderName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderPropertiesInternal)this).ServiceProviderName = (string) content.GetValueForProperty("ServiceProviderName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderPropertiesInternal)this).ServiceProviderName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderPropertiesInternal)this).ServiceProviderName = (string) content.GetValueForProperty("ServiceProviderName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderPropertiesInternal)this).ServiceProviderName, global::System.Convert.ToString); } if (content.Contains("DevPortalUrl")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderPropertiesInternal)this).DevPortalUrl = (string) content.GetValueForProperty("DevPortalUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderPropertiesInternal)this).DevPortalUrl, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderPropertiesInternal)this).DevPortalUrl = (string) content.GetValueForProperty("DevPortalUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderPropertiesInternal)this).DevPortalUrl, global::System.Convert.ToString); } if (content.Contains("IconUrl")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderPropertiesInternal)this).IconUrl = (string) content.GetValueForProperty("IconUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderPropertiesInternal)this).IconUrl, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderPropertiesInternal)this).IconUrl = (string) content.GetValueForProperty("IconUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderPropertiesInternal)this).IconUrl, global::System.Convert.ToString); } if (content.Contains("Parameter")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderPropertiesInternal)this).Parameter = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameter[]) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderPropertiesInternal)this).Parameter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ServiceProviderParameterTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderPropertiesInternal)this).Parameter = (System.Collections.Generic.List) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderPropertiesInternal)this).Parameter, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ServiceProviderParameterTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } @@ -175,6 +181,18 @@ internal ServiceProviderProperties(global::System.Management.Automation.PSObject /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.BotService.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 Object used to describe a Service Provider supported by Bot Service [System.ComponentModel.TypeConverter(typeof(ServiceProviderPropertiesTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProviderProperties.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/ServiceProviderProperties.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProviderProperties.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/ServiceProviderProperties.TypeConverter.cs index 7359d1f6bec6..2540c88ea4aa 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProviderProperties.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/ServiceProviderProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IServiceProviderProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProviderProperties.cs b/generated/BotService/BotService.Autorest/generated/api/Models/ServiceProviderProperties.cs similarity index 78% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProviderProperties.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/ServiceProviderProperties.cs index ecefe2be444b..b5de742874bc 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProviderProperties.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/ServiceProviderProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// The Object used to describe a Service Provider supported by Bot Service public partial class ServiceProviderProperties : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderProperties, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderProperties, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderPropertiesInternal { /// Backing field for property. @@ -42,26 +42,26 @@ public partial class ServiceProviderProperties : public string Id { get => this._id; } /// Internal Acessors for DevPortalUrl - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderPropertiesInternal.DevPortalUrl { get => this._devPortalUrl; set { {_devPortalUrl = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderPropertiesInternal.DevPortalUrl { get => this._devPortalUrl; set { {_devPortalUrl = value;} } } /// Internal Acessors for DisplayName - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderPropertiesInternal.DisplayName { get => this._displayName; set { {_displayName = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderPropertiesInternal.DisplayName { get => this._displayName; set { {_displayName = value;} } } /// Internal Acessors for IconUrl - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderPropertiesInternal.IconUrl { get => this._iconUrl; set { {_iconUrl = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderPropertiesInternal.IconUrl { get => this._iconUrl; set { {_iconUrl = value;} } } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderPropertiesInternal.Id { get => this._id; set { {_id = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderPropertiesInternal.Id { get => this._id; set { {_id = value;} } } /// Internal Acessors for ServiceProviderName - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderPropertiesInternal.ServiceProviderName { get => this._serviceProviderName; set { {_serviceProviderName = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderPropertiesInternal.ServiceProviderName { get => this._serviceProviderName; set { {_serviceProviderName = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameter[] _parameter; + private System.Collections.Generic.List _parameter; /// The list of parameters for the Service Provider [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameter[] Parameter { get => this._parameter; set => this._parameter = value; } + public System.Collections.Generic.List Parameter { get => this._parameter; set => this._parameter = value; } /// Backing field for property. private string _serviceProviderName; @@ -84,6 +84,9 @@ public partial interface IServiceProviderProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Display Name of the Service Provider", SerializedName = @"devPortalUrl", PossibleTypes = new [] { typeof(string) })] @@ -92,6 +95,9 @@ public partial interface IServiceProviderProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Display Name of the Service Provider", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -100,6 +106,9 @@ public partial interface IServiceProviderProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Display Name of the Service Provider", SerializedName = @"iconUrl", PossibleTypes = new [] { typeof(string) })] @@ -108,6 +117,9 @@ public partial interface IServiceProviderProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Id for Service Provider", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -116,14 +128,20 @@ public partial interface IServiceProviderProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of parameters for the Service Provider", SerializedName = @"parameters", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameter) })] - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameter[] Parameter { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderParameter) })] + System.Collections.Generic.List Parameter { get; set; } /// Display Name of the Service Provider [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Display Name of the Service Provider", SerializedName = @"serviceProviderName", PossibleTypes = new [] { typeof(string) })] @@ -143,7 +161,7 @@ internal partial interface IServiceProviderPropertiesInternal /// Id for Service Provider string Id { get; set; } /// The list of parameters for the Service Provider - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderParameter[] Parameter { get; set; } + System.Collections.Generic.List Parameter { get; set; } /// Display Name of the Service Provider string ServiceProviderName { get; set; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProviderProperties.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/ServiceProviderProperties.json.cs similarity index 87% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProviderProperties.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/ServiceProviderProperties.json.cs index 4c4c60c8ae57..64ad6a9f1ca3 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProviderProperties.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/ServiceProviderProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ServiceProviderProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new ServiceProviderProperties(json) : null; } @@ -77,12 +77,12 @@ internal ServiceProviderProperties(Microsoft.Azure.PowerShell.Cmdlets.BotService { 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;} - {_serviceProviderName = If( json?.PropertyT("serviceProviderName"), out var __jsonServiceProviderName) ? (string)__jsonServiceProviderName : (string)ServiceProviderName;} - {_devPortalUrl = If( json?.PropertyT("devPortalUrl"), out var __jsonDevPortalUrl) ? (string)__jsonDevPortalUrl : (string)DevPortalUrl;} - {_iconUrl = If( json?.PropertyT("iconUrl"), out var __jsonIconUrl) ? (string)__jsonIconUrl : (string)IconUrl;} - {_parameter = If( json?.PropertyT("parameters"), out var __jsonParameters) ? If( __jsonParameters as Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IServiceProviderParameter) (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ServiceProviderParameter.FromJson(__u) )) ))() : null : Parameter;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)_displayName;} + {_serviceProviderName = If( json?.PropertyT("serviceProviderName"), out var __jsonServiceProviderName) ? (string)__jsonServiceProviderName : (string)_serviceProviderName;} + {_devPortalUrl = If( json?.PropertyT("devPortalUrl"), out var __jsonDevPortalUrl) ? (string)__jsonDevPortalUrl : (string)_devPortalUrl;} + {_iconUrl = If( json?.PropertyT("iconUrl"), out var __jsonIconUrl) ? (string)__jsonIconUrl : (string)_iconUrl;} + {_parameter = If( json?.PropertyT("parameters"), out var __jsonParameters) ? If( __jsonParameters as Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.IServiceProviderParameter) (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ServiceProviderParameter.FromJson(__u) )) ))() : null : _parameter;} AfterFromJson(json); } @@ -105,23 +105,23 @@ public Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode ToJso { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._displayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._displayName.ToString()) : null, "displayName" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._serviceProviderName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._serviceProviderName.ToString()) : null, "serviceProviderName" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._devPortalUrl)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._devPortalUrl.ToString()) : null, "devPortalUrl" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._iconUrl)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._iconUrl.ToString()) : null, "iconUrl" ,container.Add ); } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProviderResponseList.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/ServiceProviderResponseList.PowerShell.cs similarity index 69% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProviderResponseList.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/ServiceProviderResponseList.PowerShell.cs index a7327bb47e22..e9d861695839 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProviderResponseList.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/ServiceProviderResponseList.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class ServiceProviderResponseList 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.BotService.Models.Api20220615Preview.IServiceProviderResponseList DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderResponseList DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ServiceProviderResponseList(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.BotService.Models.Api20220615Preview.IServiceProviderResponseList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderResponseList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ServiceProviderResponseList(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Pr /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderResponseList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderResponseList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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 +111,17 @@ internal ServiceProviderResponseList(global::System.Collections.IDictionary cont // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderResponseListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderResponseListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderResponseListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderResponseListInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderResponseListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProvider[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderResponseListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ServiceProviderTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderResponseListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderResponseListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ServiceProviderTypeConverter.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,11 +136,11 @@ internal ServiceProviderResponseList(global::System.Management.Automation.PSObje // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderResponseListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderResponseListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderResponseListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderResponseListInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderResponseListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProvider[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderResponseListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ServiceProviderTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderResponseListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderResponseListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ServiceProviderTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } @@ -143,6 +149,18 @@ internal ServiceProviderResponseList(global::System.Management.Automation.PSObje /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.BotService.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 list of bot service providers response. [System.ComponentModel.TypeConverter(typeof(ServiceProviderResponseListTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProviderResponseList.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/ServiceProviderResponseList.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProviderResponseList.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/ServiceProviderResponseList.TypeConverter.cs index 14e47b650308..788d26a5de51 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProviderResponseList.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/ServiceProviderResponseList.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IServiceProviderResponseList ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderResponseList ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderResponseList).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderResponseList).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProviderResponseList.cs b/generated/BotService/BotService.Autorest/generated/api/Models/ServiceProviderResponseList.cs similarity index 70% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProviderResponseList.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/ServiceProviderResponseList.cs index 452bb5798c56..a4b6094ac295 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProviderResponseList.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/ServiceProviderResponseList.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// The list of bot service providers response. public partial class ServiceProviderResponseList : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderResponseList, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderResponseListInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderResponseList, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderResponseListInternal { /// Internal Acessors for Value - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProvider[] Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderResponseListInternal.Value { get => this._value; set { {_value = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderResponseListInternal.Value { get => this._value; set { {_value = value;} } } /// Backing field for property. private string _nextLink; @@ -24,11 +24,11 @@ public partial class ServiceProviderResponseList : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProvider[] _value; + private System.Collections.Generic.List _value; /// Gets the list of bot service providers and their properties. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProvider[] Value { get => this._value; } + public System.Collections.Generic.List Value { get => this._value; } /// Creates an new instance. public ServiceProviderResponseList() @@ -44,6 +44,9 @@ public partial interface IServiceProviderResponseList : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The link used to get the next page of bot service providers.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -52,10 +55,13 @@ public partial interface IServiceProviderResponseList : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Gets the list of bot service providers and their properties.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProvider) })] - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProvider[] Value { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProvider) })] + System.Collections.Generic.List Value { get; } } /// The list of bot service providers response. @@ -65,7 +71,7 @@ internal partial interface IServiceProviderResponseListInternal /// The link used to get the next page of bot service providers. string NextLink { get; set; } /// Gets the list of bot service providers and their properties. - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProvider[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProviderResponseList.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/ServiceProviderResponseList.json.cs similarity index 88% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProviderResponseList.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/ServiceProviderResponseList.json.cs index bb6ae51f97db..6042a64e7c58 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/ServiceProviderResponseList.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/ServiceProviderResponseList.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ServiceProviderResponseList partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderResponseList. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderResponseList. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderResponseList. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderResponseList. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IServiceProviderResponseList FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IServiceProviderResponseList FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new ServiceProviderResponseList(json) : null; } @@ -77,8 +77,8 @@ internal ServiceProviderResponseList(Microsoft.Azure.PowerShell.Cmdlets.BotServi { return; } - {_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.BotService.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.BotService.Models.Api20220615Preview.IServiceProvider) (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ServiceProvider.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.BotService.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.BotService.Models.IServiceProvider) (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ServiceProvider.FromJson(__u) )) ))() : null : _value;} AfterFromJson(json); } @@ -102,7 +102,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode ToJso return container; } AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)) { if (null != this._value) { diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Site.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/Site.PowerShell.cs similarity index 52% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Site.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/Site.PowerShell.cs index 0b7e66385797..746e3d1e64c4 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Site.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/Site.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class Site 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.BotService.Models.Api20220615Preview.ISite DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISite DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new Site(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.BotService.Models.Api20220615Preview.ISite DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISite DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new Site(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Pr /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISite FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISite FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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. @@ -103,77 +111,77 @@ internal Site(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Key")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).Key, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).Key, global::System.Convert.ToString); } if (content.Contains("Key2")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).Key2 = (string) content.GetValueForProperty("Key2",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).Key2, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).Key2 = (string) content.GetValueForProperty("Key2",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).Key2, global::System.Convert.ToString); } if (content.Contains("IsEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsTokenEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsTokenEnabled = (bool?) content.GetValueForProperty("IsTokenEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsTokenEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsTokenEnabled = (bool?) content.GetValueForProperty("IsTokenEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsTokenEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsEndpointParametersEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsEndpointParametersEnabled = (bool?) content.GetValueForProperty("IsEndpointParametersEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsEndpointParametersEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsEndpointParametersEnabled = (bool?) content.GetValueForProperty("IsEndpointParametersEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsEndpointParametersEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsDetailedLoggingEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsDetailedLoggingEnabled = (bool?) content.GetValueForProperty("IsDetailedLoggingEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsDetailedLoggingEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsDetailedLoggingEnabled = (bool?) content.GetValueForProperty("IsDetailedLoggingEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsDetailedLoggingEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsBlockUserUploadEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsBlockUserUploadEnabled = (bool?) content.GetValueForProperty("IsBlockUserUploadEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsBlockUserUploadEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsBlockUserUploadEnabled = (bool?) content.GetValueForProperty("IsBlockUserUploadEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsBlockUserUploadEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsNoStorageEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsNoStorageEnabled = (bool?) content.GetValueForProperty("IsNoStorageEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsNoStorageEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsNoStorageEnabled = (bool?) content.GetValueForProperty("IsNoStorageEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsNoStorageEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("ETag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).ETag, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).ETag, global::System.Convert.ToString); } if (content.Contains("AppId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).AppId = (string) content.GetValueForProperty("AppId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).AppId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).AppId = (string) content.GetValueForProperty("AppId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).AppId, global::System.Convert.ToString); } if (content.Contains("IsV1Enabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsV1Enabled = (bool?) content.GetValueForProperty("IsV1Enabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsV1Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsV1Enabled = (bool?) content.GetValueForProperty("IsV1Enabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsV1Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsV3Enabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsV3Enabled = (bool?) content.GetValueForProperty("IsV3Enabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsV3Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsV3Enabled = (bool?) content.GetValueForProperty("IsV3Enabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsV3Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsSecureSiteEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsSecureSiteEnabled = (bool?) content.GetValueForProperty("IsSecureSiteEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsSecureSiteEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsSecureSiteEnabled = (bool?) content.GetValueForProperty("IsSecureSiteEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsSecureSiteEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("TrustedOrigin")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).TrustedOrigin = (string[]) content.GetValueForProperty("TrustedOrigin",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).TrustedOrigin, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).TrustedOrigin = (System.Collections.Generic.List) content.GetValueForProperty("TrustedOrigin",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).TrustedOrigin, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("IsWebchatPreviewEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsWebchatPreviewEnabled = (bool?) content.GetValueForProperty("IsWebchatPreviewEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsWebchatPreviewEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsWebchatPreviewEnabled = (bool?) content.GetValueForProperty("IsWebchatPreviewEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsWebchatPreviewEnabled, (__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. @@ -188,71 +196,71 @@ internal Site(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Key")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).Key, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).Key, global::System.Convert.ToString); } if (content.Contains("Key2")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).Key2 = (string) content.GetValueForProperty("Key2",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).Key2, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).Key2 = (string) content.GetValueForProperty("Key2",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).Key2, global::System.Convert.ToString); } if (content.Contains("IsEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsTokenEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsTokenEnabled = (bool?) content.GetValueForProperty("IsTokenEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsTokenEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsTokenEnabled = (bool?) content.GetValueForProperty("IsTokenEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsTokenEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsEndpointParametersEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsEndpointParametersEnabled = (bool?) content.GetValueForProperty("IsEndpointParametersEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsEndpointParametersEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsEndpointParametersEnabled = (bool?) content.GetValueForProperty("IsEndpointParametersEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsEndpointParametersEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsDetailedLoggingEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsDetailedLoggingEnabled = (bool?) content.GetValueForProperty("IsDetailedLoggingEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsDetailedLoggingEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsDetailedLoggingEnabled = (bool?) content.GetValueForProperty("IsDetailedLoggingEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsDetailedLoggingEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsBlockUserUploadEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsBlockUserUploadEnabled = (bool?) content.GetValueForProperty("IsBlockUserUploadEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsBlockUserUploadEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsBlockUserUploadEnabled = (bool?) content.GetValueForProperty("IsBlockUserUploadEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsBlockUserUploadEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsNoStorageEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsNoStorageEnabled = (bool?) content.GetValueForProperty("IsNoStorageEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsNoStorageEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsNoStorageEnabled = (bool?) content.GetValueForProperty("IsNoStorageEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsNoStorageEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("ETag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).ETag, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).ETag, global::System.Convert.ToString); } if (content.Contains("AppId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).AppId = (string) content.GetValueForProperty("AppId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).AppId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).AppId = (string) content.GetValueForProperty("AppId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).AppId, global::System.Convert.ToString); } if (content.Contains("IsV1Enabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsV1Enabled = (bool?) content.GetValueForProperty("IsV1Enabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsV1Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsV1Enabled = (bool?) content.GetValueForProperty("IsV1Enabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsV1Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsV3Enabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsV3Enabled = (bool?) content.GetValueForProperty("IsV3Enabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsV3Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsV3Enabled = (bool?) content.GetValueForProperty("IsV3Enabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsV3Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsSecureSiteEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsSecureSiteEnabled = (bool?) content.GetValueForProperty("IsSecureSiteEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsSecureSiteEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsSecureSiteEnabled = (bool?) content.GetValueForProperty("IsSecureSiteEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsSecureSiteEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("TrustedOrigin")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).TrustedOrigin = (string[]) content.GetValueForProperty("TrustedOrigin",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).TrustedOrigin, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).TrustedOrigin = (System.Collections.Generic.List) content.GetValueForProperty("TrustedOrigin",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).TrustedOrigin, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("IsWebchatPreviewEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsWebchatPreviewEnabled = (bool?) content.GetValueForProperty("IsWebchatPreviewEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsWebchatPreviewEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsWebchatPreviewEnabled = (bool?) content.GetValueForProperty("IsWebchatPreviewEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsWebchatPreviewEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializePSObject(content); } @@ -261,6 +269,18 @@ internal Site(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.BotService.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 site for the channel [System.ComponentModel.TypeConverter(typeof(SiteTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Site.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/Site.TypeConverter.cs similarity index 97% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Site.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/Site.TypeConverter.cs index 86c1ca62d02a..f78e062a706c 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Site.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/Site.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.ISite ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISite ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISite).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISite).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Site.cs b/generated/BotService/BotService.Autorest/generated/api/Models/Site.cs similarity index 90% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Site.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/Site.cs index 6640eba9eaee..a840fd01bd14 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Site.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/Site.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// A site for the channel public partial class Site : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISite, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISite, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal { /// Backing field for property. @@ -123,16 +123,16 @@ public partial class Site : public string Key2 { get => this._key2; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal.Id { get => this._id; set { {_id = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal.Id { get => this._id; set { {_id = value;} } } /// Internal Acessors for IsTokenEnabled - bool? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal.IsTokenEnabled { get => this._isTokenEnabled; set { {_isTokenEnabled = value;} } } + bool? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal.IsTokenEnabled { get => this._isTokenEnabled; set { {_isTokenEnabled = value;} } } /// Internal Acessors for Key - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal.Key { get => this._key; set { {_key = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal.Key { get => this._key; set { {_key = value;} } } /// Internal Acessors for Key2 - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal.Key2 { get => this._key2; set { {_key2 = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal.Key2 { get => this._key2; set { {_key2 = value;} } } /// Backing field for property. private string _name; @@ -142,13 +142,13 @@ public partial class Site : public string Name { get => this._name; set => this._name = value; } /// Backing field for property. - private string[] _trustedOrigin; + private System.Collections.Generic.List _trustedOrigin; /// /// List of Trusted Origin URLs for this site. This field is applicable only if isSecureSiteEnabled is True. /// [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Owned)] - public string[] TrustedOrigin { get => this._trustedOrigin; set => this._trustedOrigin = value; } + public System.Collections.Generic.List TrustedOrigin { get => this._trustedOrigin; set => this._trustedOrigin = value; } /// Creates an new instance. public Site() @@ -164,6 +164,9 @@ public partial interface ISite : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"DirectLine application id", SerializedName = @"appId", PossibleTypes = new [] { typeof(string) })] @@ -172,6 +175,9 @@ public partial interface ISite : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Entity Tag", SerializedName = @"eTag", PossibleTypes = new [] { typeof(string) })] @@ -180,6 +186,9 @@ public partial interface ISite : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Site Id", SerializedName = @"siteId", PossibleTypes = new [] { typeof(string) })] @@ -188,6 +197,9 @@ public partial interface ISite : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Whether this site is enabled for block user upload.", SerializedName = @"isBlockUserUploadEnabled", PossibleTypes = new [] { typeof(bool) })] @@ -196,6 +208,9 @@ public partial interface ISite : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Whether this site is disabled detailed logging for", SerializedName = @"isDetailedLoggingEnabled", PossibleTypes = new [] { typeof(bool) })] @@ -204,6 +219,9 @@ public partial interface ISite : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Whether this site is enabled for DirectLine channel", SerializedName = @"isEnabled", PossibleTypes = new [] { typeof(bool) })] @@ -212,6 +230,9 @@ public partial interface ISite : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Whether this site is EndpointParameters enabled for channel", SerializedName = @"isEndpointParametersEnabled", PossibleTypes = new [] { typeof(bool) })] @@ -220,6 +241,9 @@ public partial interface ISite : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Whether this no-storage site is disabled detailed logging for", SerializedName = @"isNoStorageEnabled", PossibleTypes = new [] { typeof(bool) })] @@ -228,6 +252,9 @@ public partial interface ISite : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Whether this site is enabled for authentication with Bot Framework.", SerializedName = @"isSecureSiteEnabled", PossibleTypes = new [] { typeof(bool) })] @@ -236,6 +263,9 @@ public partial interface ISite : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Whether this site is token enabled for channel", SerializedName = @"isTokenEnabled", PossibleTypes = new [] { typeof(bool) })] @@ -244,6 +274,9 @@ public partial interface ISite : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Whether this site is enabled for Bot Framework V1 protocol.", SerializedName = @"isV1Enabled", PossibleTypes = new [] { typeof(bool) })] @@ -252,6 +285,9 @@ public partial interface ISite : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Whether this site is enabled for Bot Framework V1 protocol.", SerializedName = @"isV3Enabled", PossibleTypes = new [] { typeof(bool) })] @@ -260,6 +296,9 @@ public partial interface ISite : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Whether this site is enabled for preview versions of Webchat", SerializedName = @"isWebchatPreviewEnabled", PossibleTypes = new [] { typeof(bool) })] @@ -270,6 +309,9 @@ public partial interface ISite : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Primary key. Value only returned through POST to the action Channel List API, otherwise empty.", SerializedName = @"key", PossibleTypes = new [] { typeof(string) })] @@ -280,6 +322,9 @@ public partial interface ISite : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Secondary key. Value only returned through POST to the action Channel List API, otherwise empty.", SerializedName = @"key2", PossibleTypes = new [] { typeof(string) })] @@ -288,6 +333,9 @@ public partial interface ISite : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Site name", SerializedName = @"siteName", PossibleTypes = new [] { typeof(string) })] @@ -298,10 +346,13 @@ public partial interface ISite : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"List of Trusted Origin URLs for this site. This field is applicable only if isSecureSiteEnabled is True.", SerializedName = @"trustedOrigins", PossibleTypes = new [] { typeof(string) })] - string[] TrustedOrigin { get; set; } + System.Collections.Generic.List TrustedOrigin { get; set; } } /// A site for the channel @@ -347,7 +398,7 @@ internal partial interface ISiteInternal /// /// List of Trusted Origin URLs for this site. This field is applicable only if isSecureSiteEnabled is True. /// - string[] TrustedOrigin { get; set; } + System.Collections.Generic.List TrustedOrigin { get; set; } } } \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Site.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/Site.json.cs similarity index 88% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Site.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/Site.json.cs index e7c564bcc811..7ec770241ee2 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Site.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/Site.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -54,13 +54,11 @@ public partial class Site partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISite. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISite. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISite. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISite FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISite. + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISite FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new Site(json) : null; } @@ -77,23 +75,23 @@ internal Site(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObj { return; } - {_id = If( json?.PropertyT("siteId"), out var __jsonSiteId) ? (string)__jsonSiteId : (string)Id;} - {_name = If( json?.PropertyT("siteName"), out var __jsonSiteName) ? (string)__jsonSiteName : (string)Name;} - {_key = If( json?.PropertyT("key"), out var __jsonKey) ? (string)__jsonKey : (string)Key;} - {_key2 = If( json?.PropertyT("key2"), out var __jsonKey2) ? (string)__jsonKey2 : (string)Key2;} - {_isEnabled = If( json?.PropertyT("isEnabled"), out var __jsonIsEnabled) ? (bool)__jsonIsEnabled : IsEnabled;} - {_isTokenEnabled = If( json?.PropertyT("isTokenEnabled"), out var __jsonIsTokenEnabled) ? (bool?)__jsonIsTokenEnabled : IsTokenEnabled;} - {_isEndpointParametersEnabled = If( json?.PropertyT("isEndpointParametersEnabled"), out var __jsonIsEndpointParametersEnabled) ? (bool?)__jsonIsEndpointParametersEnabled : IsEndpointParametersEnabled;} - {_isDetailedLoggingEnabled = If( json?.PropertyT("isDetailedLoggingEnabled"), out var __jsonIsDetailedLoggingEnabled) ? (bool?)__jsonIsDetailedLoggingEnabled : IsDetailedLoggingEnabled;} - {_isBlockUserUploadEnabled = If( json?.PropertyT("isBlockUserUploadEnabled"), out var __jsonIsBlockUserUploadEnabled) ? (bool?)__jsonIsBlockUserUploadEnabled : IsBlockUserUploadEnabled;} - {_isNoStorageEnabled = If( json?.PropertyT("isNoStorageEnabled"), out var __jsonIsNoStorageEnabled) ? (bool?)__jsonIsNoStorageEnabled : IsNoStorageEnabled;} - {_eTag = If( json?.PropertyT("eTag"), out var __jsonETag) ? (string)__jsonETag : (string)ETag;} - {_appId = If( json?.PropertyT("appId"), out var __jsonAppId) ? (string)__jsonAppId : (string)AppId;} - {_isV1Enabled = If( json?.PropertyT("isV1Enabled"), out var __jsonIsV1Enabled) ? (bool?)__jsonIsV1Enabled : IsV1Enabled;} - {_isV3Enabled = If( json?.PropertyT("isV3Enabled"), out var __jsonIsV3Enabled) ? (bool?)__jsonIsV3Enabled : IsV3Enabled;} - {_isSecureSiteEnabled = If( json?.PropertyT("isSecureSiteEnabled"), out var __jsonIsSecureSiteEnabled) ? (bool?)__jsonIsSecureSiteEnabled : IsSecureSiteEnabled;} - {_trustedOrigin = If( json?.PropertyT("trustedOrigins"), out var __jsonTrustedOrigins) ? If( __jsonTrustedOrigins as Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : TrustedOrigin;} - {_isWebchatPreviewEnabled = If( json?.PropertyT("isWebchatPreviewEnabled"), out var __jsonIsWebchatPreviewEnabled) ? (bool?)__jsonIsWebchatPreviewEnabled : IsWebchatPreviewEnabled;} + {_id = If( json?.PropertyT("siteId"), out var __jsonSiteId) ? (string)__jsonSiteId : (string)_id;} + {_name = If( json?.PropertyT("siteName"), out var __jsonSiteName) ? (string)__jsonSiteName : (string)_name;} + {_key = If( json?.PropertyT("key"), out var __jsonKey) ? (string)__jsonKey : (string)_key;} + {_key2 = If( json?.PropertyT("key2"), out var __jsonKey2) ? (string)__jsonKey2 : (string)_key2;} + {_isEnabled = If( json?.PropertyT("isEnabled"), out var __jsonIsEnabled) ? (bool)__jsonIsEnabled : _isEnabled;} + {_isTokenEnabled = If( json?.PropertyT("isTokenEnabled"), out var __jsonIsTokenEnabled) ? (bool?)__jsonIsTokenEnabled : _isTokenEnabled;} + {_isEndpointParametersEnabled = If( json?.PropertyT("isEndpointParametersEnabled"), out var __jsonIsEndpointParametersEnabled) ? (bool?)__jsonIsEndpointParametersEnabled : _isEndpointParametersEnabled;} + {_isDetailedLoggingEnabled = If( json?.PropertyT("isDetailedLoggingEnabled"), out var __jsonIsDetailedLoggingEnabled) ? (bool?)__jsonIsDetailedLoggingEnabled : _isDetailedLoggingEnabled;} + {_isBlockUserUploadEnabled = If( json?.PropertyT("isBlockUserUploadEnabled"), out var __jsonIsBlockUserUploadEnabled) ? (bool?)__jsonIsBlockUserUploadEnabled : _isBlockUserUploadEnabled;} + {_isNoStorageEnabled = If( json?.PropertyT("isNoStorageEnabled"), out var __jsonIsNoStorageEnabled) ? (bool?)__jsonIsNoStorageEnabled : _isNoStorageEnabled;} + {_eTag = If( json?.PropertyT("eTag"), out var __jsonETag) ? (string)__jsonETag : (string)_eTag;} + {_appId = If( json?.PropertyT("appId"), out var __jsonAppId) ? (string)__jsonAppId : (string)_appId;} + {_isV1Enabled = If( json?.PropertyT("isV1Enabled"), out var __jsonIsV1Enabled) ? (bool?)__jsonIsV1Enabled : _isV1Enabled;} + {_isV3Enabled = If( json?.PropertyT("isV3Enabled"), out var __jsonIsV3Enabled) ? (bool?)__jsonIsV3Enabled : _isV3Enabled;} + {_isSecureSiteEnabled = If( json?.PropertyT("isSecureSiteEnabled"), out var __jsonIsSecureSiteEnabled) ? (bool?)__jsonIsSecureSiteEnabled : _isSecureSiteEnabled;} + {_trustedOrigin = If( json?.PropertyT("trustedOrigins"), out var __jsonTrustedOrigins) ? If( __jsonTrustedOrigins as Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _trustedOrigin;} + {_isWebchatPreviewEnabled = If( json?.PropertyT("isWebchatPreviewEnabled"), out var __jsonIsWebchatPreviewEnabled) ? (bool?)__jsonIsWebchatPreviewEnabled : _isWebchatPreviewEnabled;} AfterFromJson(json); } @@ -116,21 +114,21 @@ public Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode ToJso { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._id.ToString()) : null, "siteId" ,container.Add ); } AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._name.ToString()) : null, "siteName" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._key)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._key.ToString()) : null, "key" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._key2)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._key2.ToString()) : null, "key2" ,container.Add ); } AddIf( (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonBoolean(this._isEnabled), "isEnabled" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._isTokenEnabled ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonBoolean((bool)this._isTokenEnabled) : null, "isTokenEnabled" ,container.Add ); } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SiteInfo.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/SiteInfo.PowerShell.cs similarity index 75% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SiteInfo.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/SiteInfo.PowerShell.cs index 6a7d6680519f..7d44b94bfe31 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SiteInfo.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/SiteInfo.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -57,27 +57,35 @@ public partial class SiteInfo 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.BotService.Models.Api20220615Preview.ISiteInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new SiteInfo(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.BotService.Models.Api20220615Preview.ISiteInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new SiteInfo(content); } @@ -87,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Pr /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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 SiteInfo(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("SiteName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInfoInternal)this).SiteName = (string) content.GetValueForProperty("SiteName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInfoInternal)this).SiteName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInfoInternal)this).SiteName = (string) content.GetValueForProperty("SiteName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInfoInternal)this).SiteName, global::System.Convert.ToString); } if (content.Contains("Key")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInfoInternal)this).Key = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Key) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInfoInternal)this).Key, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Key.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInfoInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInfoInternal)this).Key, 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 SiteInfo(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("SiteName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInfoInternal)this).SiteName = (string) content.GetValueForProperty("SiteName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInfoInternal)this).SiteName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInfoInternal)this).SiteName = (string) content.GetValueForProperty("SiteName",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInfoInternal)this).SiteName, global::System.Convert.ToString); } if (content.Contains("Key")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInfoInternal)this).Key = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Key) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInfoInternal)this).Key, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Key.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInfoInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInfoInternal)this).Key, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -143,6 +151,18 @@ internal SiteInfo(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.BotService.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(); + } } /// Site information for WebChat or DirectLine Channels to identify which site to regenerate keys for. [System.ComponentModel.TypeConverter(typeof(SiteInfoTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SiteInfo.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/SiteInfo.TypeConverter.cs similarity index 97% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SiteInfo.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/SiteInfo.TypeConverter.cs index 654c21a108fc..355d7a833f55 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SiteInfo.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/SiteInfo.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.ISiteInfo ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInfo ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInfo).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInfo).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SiteInfo.cs b/generated/BotService/BotService.Autorest/generated/api/Models/SiteInfo.cs similarity index 76% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SiteInfo.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/SiteInfo.cs index 4433d05a344a..f64740dd71a7 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SiteInfo.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/SiteInfo.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -11,16 +11,16 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Previe /// Site information for WebChat or DirectLine Channels to identify which site to regenerate keys for. /// public partial class SiteInfo : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInfo, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInfoInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInfo, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInfoInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Key _key; + private string _key; /// Determines which key is to be regenerated [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Key Key { get => this._key; set => this._key = value; } + public string Key { get => this._key; set => this._key = value; } /// Backing field for property. private string _siteName; @@ -43,14 +43,21 @@ public partial interface ISiteInfo : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Determines which key is to be regenerated", SerializedName = @"key", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Key) })] - Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Key Key { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("key1", "key2")] + string Key { get; set; } /// The site name [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The site name", SerializedName = @"siteName", PossibleTypes = new [] { typeof(string) })] @@ -62,7 +69,8 @@ internal partial interface ISiteInfoInternal { /// Determines which key is to be regenerated - Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Key Key { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("key1", "key2")] + string Key { get; set; } /// The site name string SiteName { get; set; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SiteInfo.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/SiteInfo.json.cs similarity index 92% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SiteInfo.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/SiteInfo.json.cs index 750db8034eae..46f98ba05bb0 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SiteInfo.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/SiteInfo.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -56,13 +56,11 @@ public partial class SiteInfo partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInfo. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInfo. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInfo. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInfo. + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new SiteInfo(json) : null; } @@ -79,8 +77,8 @@ internal SiteInfo(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.Jso { return; } - {_siteName = If( json?.PropertyT("siteName"), out var __jsonSiteName) ? (string)__jsonSiteName : (string)SiteName;} - {_key = If( json?.PropertyT("key"), out var __jsonKey) ? (string)__jsonKey : (string)Key;} + {_siteName = If( json?.PropertyT("siteName"), out var __jsonSiteName) ? (string)__jsonSiteName : (string)_siteName;} + {_key = If( json?.PropertyT("key"), out var __jsonKey) ? (string)__jsonKey : (string)_key;} AfterFromJson(json); } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Sku.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/Sku.PowerShell.cs similarity index 76% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Sku.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/Sku.PowerShell.cs index 6739c6899f9c..b37839e68b26 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Sku.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/Sku.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class Sku 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.BotService.Models.Api20220615Preview.ISku DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISku DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new Sku(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.BotService.Models.Api20220615Preview.ISku DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISku DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new Sku(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Pr /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISku FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISku FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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. @@ -103,17 +111,17 @@ internal Sku(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkuInternal)this).Name = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkuInternal)this).Name, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkuInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkuInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Tier")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkuInternal)this).Tier = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuTier?) content.GetValueForProperty("Tier",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkuInternal)this).Tier, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuTier.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkuInternal)this).Tier = (string) content.GetValueForProperty("Tier",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkuInternal)this).Tier, 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. @@ -128,11 +136,11 @@ internal Sku(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkuInternal)this).Name = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkuInternal)this).Name, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkuInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkuInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Tier")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkuInternal)this).Tier = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuTier?) content.GetValueForProperty("Tier",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkuInternal)this).Tier, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuTier.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkuInternal)this).Tier = (string) content.GetValueForProperty("Tier",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkuInternal)this).Tier, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -141,6 +149,18 @@ internal Sku(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.BotService.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 SKU of the cognitive services account. [System.ComponentModel.TypeConverter(typeof(SkuTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Sku.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/Sku.TypeConverter.cs similarity index 97% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Sku.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/Sku.TypeConverter.cs index 63d31de3f58e..83bec452c598 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Sku.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/Sku.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.ISku ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISku ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISku).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISku).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Sku.cs b/generated/BotService/BotService.Autorest/generated/api/Models/Sku.cs similarity index 60% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Sku.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/Sku.cs index 0c3ffe9a53d9..4b1fb9780464 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Sku.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/Sku.cs @@ -3,32 +3,32 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// The SKU of the cognitive services account. public partial class Sku : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISku, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkuInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISku, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkuInternal { /// Internal Acessors for Tier - Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuTier? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkuInternal.Tier { get => this._tier; set { {_tier = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkuInternal.Tier { get => this._tier; set { {_tier = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName _name; + private string _name; /// The sku name [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName Name { get => this._name; set => this._name = value; } + public string Name { get => this._name; set => this._name = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuTier? _tier; + private string _tier; /// Gets the sku tier. This is based on the SKU name. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuTier? Tier { get => this._tier; } + public string Tier { get => this._tier; } /// Creates an new instance. public Sku() @@ -44,18 +44,26 @@ public partial interface ISku : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The sku name", SerializedName = @"name", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName) })] - Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName Name { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("F0", "S1")] + string Name { get; set; } /// Gets the sku tier. This is based on the SKU name. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Gets the sku tier. This is based on the SKU name.", SerializedName = @"tier", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuTier) })] - Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuTier? Tier { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("Free", "Standard")] + string Tier { get; } } /// The SKU of the cognitive services account. @@ -63,9 +71,11 @@ internal partial interface ISkuInternal { /// The sku name - Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName Name { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("F0", "S1")] + string Name { get; set; } /// Gets the sku tier. This is based on the SKU name. - Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuTier? Tier { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("Free", "Standard")] + string Tier { get; set; } } } \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Sku.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/Sku.json.cs similarity index 91% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Sku.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/Sku.json.cs index 8005529d0e1e..db02e245c350 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/Sku.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/Sku.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -54,13 +54,11 @@ public partial class Sku partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISku. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISku. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISku. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISku FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISku. + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISku FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new Sku(json) : null; } @@ -77,8 +75,8 @@ internal Sku(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObje { return; } - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_tier = If( json?.PropertyT("tier"), out var __jsonTier) ? (string)__jsonTier : (string)Tier;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_tier = If( json?.PropertyT("tier"), out var __jsonTier) ? (string)__jsonTier : (string)_tier;} AfterFromJson(json); } @@ -102,7 +100,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode ToJso return container; } AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._tier)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._tier.ToString()) : null, "tier" ,container.Add ); } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SkypeChannel.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/SkypeChannel.PowerShell.cs similarity index 52% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SkypeChannel.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/SkypeChannel.PowerShell.cs index 6272700bd4b5..72b6c902d1d5 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SkypeChannel.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/SkypeChannel.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class SkypeChannel 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.BotService.Models.Api20220615Preview.ISkypeChannel DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannel DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new SkypeChannel(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.BotService.Models.Api20220615Preview.ISkypeChannel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new SkypeChannel(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Pr /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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. @@ -103,69 +111,69 @@ internal SkypeChannel(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SkypeChannelPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.SkypeChannelPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Etag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Etag, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Etag, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).ProvisioningState, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("EnableMessaging")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelInternal)this).EnableMessaging = (bool?) content.GetValueForProperty("EnableMessaging",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelInternal)this).EnableMessaging, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelInternal)this).EnableMessaging = (bool?) content.GetValueForProperty("EnableMessaging",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelInternal)this).EnableMessaging, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("EnableMediaCard")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelInternal)this).EnableMediaCard = (bool?) content.GetValueForProperty("EnableMediaCard",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelInternal)this).EnableMediaCard, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelInternal)this).EnableMediaCard = (bool?) content.GetValueForProperty("EnableMediaCard",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelInternal)this).EnableMediaCard, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("EnableVideo")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelInternal)this).EnableVideo = (bool?) content.GetValueForProperty("EnableVideo",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelInternal)this).EnableVideo, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelInternal)this).EnableVideo = (bool?) content.GetValueForProperty("EnableVideo",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelInternal)this).EnableVideo, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("EnableCalling")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelInternal)this).EnableCalling = (bool?) content.GetValueForProperty("EnableCalling",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelInternal)this).EnableCalling, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelInternal)this).EnableCalling = (bool?) content.GetValueForProperty("EnableCalling",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelInternal)this).EnableCalling, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("EnableScreenSharing")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelInternal)this).EnableScreenSharing = (bool?) content.GetValueForProperty("EnableScreenSharing",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelInternal)this).EnableScreenSharing, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelInternal)this).EnableScreenSharing = (bool?) content.GetValueForProperty("EnableScreenSharing",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelInternal)this).EnableScreenSharing, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("EnableGroup")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelInternal)this).EnableGroup = (bool?) content.GetValueForProperty("EnableGroup",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelInternal)this).EnableGroup, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelInternal)this).EnableGroup = (bool?) content.GetValueForProperty("EnableGroup",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelInternal)this).EnableGroup, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("GroupsMode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelInternal)this).GroupsMode = (string) content.GetValueForProperty("GroupsMode",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelInternal)this).GroupsMode, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelInternal)this).GroupsMode = (string) content.GetValueForProperty("GroupsMode",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelInternal)this).GroupsMode, global::System.Convert.ToString); } if (content.Contains("CallingWebHook")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelInternal)this).CallingWebHook = (string) content.GetValueForProperty("CallingWebHook",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelInternal)this).CallingWebHook, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelInternal)this).CallingWebHook = (string) content.GetValueForProperty("CallingWebHook",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelInternal)this).CallingWebHook, global::System.Convert.ToString); } if (content.Contains("IncomingCallRoute")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelInternal)this).IncomingCallRoute = (string) content.GetValueForProperty("IncomingCallRoute",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelInternal)this).IncomingCallRoute, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelInternal)this).IncomingCallRoute = (string) content.GetValueForProperty("IncomingCallRoute",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelInternal)this).IncomingCallRoute, global::System.Convert.ToString); } if (content.Contains("IsEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelInternal)this).IsEnabled = (bool?) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelInternal)this).IsEnabled, (__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. @@ -180,63 +188,63 @@ internal SkypeChannel(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SkypeChannelPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.SkypeChannelPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Etag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Etag, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Etag, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).ProvisioningState, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("EnableMessaging")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelInternal)this).EnableMessaging = (bool?) content.GetValueForProperty("EnableMessaging",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelInternal)this).EnableMessaging, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelInternal)this).EnableMessaging = (bool?) content.GetValueForProperty("EnableMessaging",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelInternal)this).EnableMessaging, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("EnableMediaCard")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelInternal)this).EnableMediaCard = (bool?) content.GetValueForProperty("EnableMediaCard",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelInternal)this).EnableMediaCard, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelInternal)this).EnableMediaCard = (bool?) content.GetValueForProperty("EnableMediaCard",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelInternal)this).EnableMediaCard, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("EnableVideo")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelInternal)this).EnableVideo = (bool?) content.GetValueForProperty("EnableVideo",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelInternal)this).EnableVideo, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelInternal)this).EnableVideo = (bool?) content.GetValueForProperty("EnableVideo",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelInternal)this).EnableVideo, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("EnableCalling")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelInternal)this).EnableCalling = (bool?) content.GetValueForProperty("EnableCalling",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelInternal)this).EnableCalling, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelInternal)this).EnableCalling = (bool?) content.GetValueForProperty("EnableCalling",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelInternal)this).EnableCalling, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("EnableScreenSharing")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelInternal)this).EnableScreenSharing = (bool?) content.GetValueForProperty("EnableScreenSharing",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelInternal)this).EnableScreenSharing, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelInternal)this).EnableScreenSharing = (bool?) content.GetValueForProperty("EnableScreenSharing",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelInternal)this).EnableScreenSharing, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("EnableGroup")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelInternal)this).EnableGroup = (bool?) content.GetValueForProperty("EnableGroup",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelInternal)this).EnableGroup, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelInternal)this).EnableGroup = (bool?) content.GetValueForProperty("EnableGroup",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelInternal)this).EnableGroup, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("GroupsMode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelInternal)this).GroupsMode = (string) content.GetValueForProperty("GroupsMode",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelInternal)this).GroupsMode, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelInternal)this).GroupsMode = (string) content.GetValueForProperty("GroupsMode",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelInternal)this).GroupsMode, global::System.Convert.ToString); } if (content.Contains("CallingWebHook")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelInternal)this).CallingWebHook = (string) content.GetValueForProperty("CallingWebHook",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelInternal)this).CallingWebHook, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelInternal)this).CallingWebHook = (string) content.GetValueForProperty("CallingWebHook",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelInternal)this).CallingWebHook, global::System.Convert.ToString); } if (content.Contains("IncomingCallRoute")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelInternal)this).IncomingCallRoute = (string) content.GetValueForProperty("IncomingCallRoute",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelInternal)this).IncomingCallRoute, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelInternal)this).IncomingCallRoute = (string) content.GetValueForProperty("IncomingCallRoute",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelInternal)this).IncomingCallRoute, global::System.Convert.ToString); } if (content.Contains("IsEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelInternal)this).IsEnabled = (bool?) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializePSObject(content); } @@ -245,6 +253,18 @@ internal SkypeChannel(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.BotService.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(); + } } /// Skype channel definition [System.ComponentModel.TypeConverter(typeof(SkypeChannelTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SkypeChannel.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/SkypeChannel.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SkypeChannel.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/SkypeChannel.TypeConverter.cs index a8e0e7b6c313..6ef4d85d75cb 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SkypeChannel.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/SkypeChannel.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.ISkypeChannel ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannel ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannel).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannel).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SkypeChannel.cs b/generated/BotService/BotService.Autorest/generated/api/Models/SkypeChannel.cs similarity index 67% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SkypeChannel.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/SkypeChannel.cs index 78fd14a538c8..6c0352c160e5 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SkypeChannel.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/SkypeChannel.cs @@ -3,95 +3,95 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// Skype channel definition public partial class SkypeChannel : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannel, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelInternal, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannel, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelInternal, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannel __channel = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Channel(); + private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannel __channel = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Channel(); /// Calling web hook for Skype channel [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string CallingWebHook { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelPropertiesInternal)Property).CallingWebHook; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelPropertiesInternal)Property).CallingWebHook = value ?? null; } + public string CallingWebHook { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelPropertiesInternal)Property).CallingWebHook; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelPropertiesInternal)Property).CallingWebHook = value ?? null; } /// Enable calling for Skype channel [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public bool? EnableCalling { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelPropertiesInternal)Property).EnableCalling; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelPropertiesInternal)Property).EnableCalling = value ?? default(bool); } + public bool? EnableCalling { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelPropertiesInternal)Property).EnableCalling; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelPropertiesInternal)Property).EnableCalling = value ?? default(bool); } /// Enable groups for Skype channel [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public bool? EnableGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelPropertiesInternal)Property).EnableGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelPropertiesInternal)Property).EnableGroup = value ?? default(bool); } + public bool? EnableGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelPropertiesInternal)Property).EnableGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelPropertiesInternal)Property).EnableGroup = value ?? default(bool); } /// Enable media cards for Skype channel [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public bool? EnableMediaCard { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelPropertiesInternal)Property).EnableMediaCard; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelPropertiesInternal)Property).EnableMediaCard = value ?? default(bool); } + public bool? EnableMediaCard { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelPropertiesInternal)Property).EnableMediaCard; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelPropertiesInternal)Property).EnableMediaCard = value ?? default(bool); } /// Enable messaging for Skype channel [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public bool? EnableMessaging { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelPropertiesInternal)Property).EnableMessaging; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelPropertiesInternal)Property).EnableMessaging = value ?? default(bool); } + public bool? EnableMessaging { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelPropertiesInternal)Property).EnableMessaging; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelPropertiesInternal)Property).EnableMessaging = value ?? default(bool); } /// Enable screen sharing for Skype channel [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public bool? EnableScreenSharing { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelPropertiesInternal)Property).EnableScreenSharing; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelPropertiesInternal)Property).EnableScreenSharing = value ?? default(bool); } + public bool? EnableScreenSharing { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelPropertiesInternal)Property).EnableScreenSharing; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelPropertiesInternal)Property).EnableScreenSharing = value ?? default(bool); } /// Enable video for Skype channel [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public bool? EnableVideo { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelPropertiesInternal)Property).EnableVideo; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelPropertiesInternal)Property).EnableVideo = value ?? default(bool); } + public bool? EnableVideo { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelPropertiesInternal)Property).EnableVideo; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelPropertiesInternal)Property).EnableVideo = value ?? default(bool); } /// Entity Tag of the resource [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Etag = value ?? null; } + public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Etag = value ?? null; } /// Group mode for Skype channel [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string GroupsMode { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelPropertiesInternal)Property).GroupsMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelPropertiesInternal)Property).GroupsMode = value ?? null; } + public string GroupsMode { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelPropertiesInternal)Property).GroupsMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelPropertiesInternal)Property).GroupsMode = value ?? null; } /// Incoming call route for Skype channel [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string IncomingCallRoute { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelPropertiesInternal)Property).IncomingCallRoute; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelPropertiesInternal)Property).IncomingCallRoute = value ?? null; } + public string IncomingCallRoute { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelPropertiesInternal)Property).IncomingCallRoute; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelPropertiesInternal)Property).IncomingCallRoute = value ?? null; } /// Whether this channel is enabled for the bot [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public bool? IsEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelPropertiesInternal)Property).IsEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelPropertiesInternal)Property).IsEnabled = value ?? default(bool); } + public bool? IsEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelPropertiesInternal)Property).IsEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelPropertiesInternal)Property).IsEnabled = value ?? default(bool); } /// Specifies the location of the resource. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Location = value ?? null; } + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Location = value ?? null; } /// Internal Acessors for ProvisioningState - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).ProvisioningState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).ProvisioningState = value; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelProperties Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SkypeChannelProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelProperties Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.SkypeChannelProperties()); set { {_property = value;} } } /// The channel name + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Constant] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Name = value ; } + public string Name { get => "SkypeChannel"; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Name = "SkypeChannel"; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelProperties _property; /// The set of properties specific to Skype channel resource [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SkypeChannelProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.SkypeChannelProperties()); set => this._property = value; } /// Provisioning state of the resource [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).ProvisioningState; } + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).ProvisioningState; } /// Creates an new instance. public SkypeChannel() { - + this.__channel.Name = "SkypeChannel"; } /// Validates that this object meets the validation criteria. @@ -109,12 +109,15 @@ public SkypeChannel() /// Skype channel definition public partial interface ISkypeChannel : Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannel + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannel { /// Calling web hook for Skype channel [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Calling web hook for Skype channel", SerializedName = @"callingWebHook", PossibleTypes = new [] { typeof(string) })] @@ -123,6 +126,9 @@ public partial interface ISkypeChannel : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Enable calling for Skype channel", SerializedName = @"enableCalling", PossibleTypes = new [] { typeof(bool) })] @@ -131,6 +137,9 @@ public partial interface ISkypeChannel : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Enable groups for Skype channel", SerializedName = @"enableGroups", PossibleTypes = new [] { typeof(bool) })] @@ -139,6 +148,9 @@ public partial interface ISkypeChannel : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Enable media cards for Skype channel", SerializedName = @"enableMediaCards", PossibleTypes = new [] { typeof(bool) })] @@ -147,6 +159,9 @@ public partial interface ISkypeChannel : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Enable messaging for Skype channel", SerializedName = @"enableMessaging", PossibleTypes = new [] { typeof(bool) })] @@ -155,6 +170,9 @@ public partial interface ISkypeChannel : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Enable screen sharing for Skype channel", SerializedName = @"enableScreenSharing", PossibleTypes = new [] { typeof(bool) })] @@ -163,6 +181,9 @@ public partial interface ISkypeChannel : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Enable video for Skype channel", SerializedName = @"enableVideo", PossibleTypes = new [] { typeof(bool) })] @@ -171,6 +192,9 @@ public partial interface ISkypeChannel : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Group mode for Skype channel", SerializedName = @"groupsMode", PossibleTypes = new [] { typeof(string) })] @@ -179,6 +203,9 @@ public partial interface ISkypeChannel : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Incoming call route for Skype channel", SerializedName = @"incomingCallRoute", PossibleTypes = new [] { typeof(string) })] @@ -187,6 +214,9 @@ public partial interface ISkypeChannel : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Whether this channel is enabled for the bot", SerializedName = @"isEnabled", PossibleTypes = new [] { typeof(bool) })] @@ -195,7 +225,7 @@ public partial interface ISkypeChannel : } /// Skype channel definition internal partial interface ISkypeChannelInternal : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal { /// Calling web hook for Skype channel string CallingWebHook { get; set; } @@ -218,7 +248,7 @@ internal partial interface ISkypeChannelInternal : /// Whether this channel is enabled for the bot bool? IsEnabled { get; set; } /// The set of properties specific to Skype channel resource - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelProperties Property { get; set; } } } \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SkypeChannel.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/SkypeChannel.json.cs similarity index 93% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SkypeChannel.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/SkypeChannel.json.cs index a69e75ac3c63..552c6f4fc37a 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SkypeChannel.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/SkypeChannel.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class SkypeChannel partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannel. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannel. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannel. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannel. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannel FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannel FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new SkypeChannel(json) : null; } @@ -77,8 +77,8 @@ internal SkypeChannel(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json { return; } - __channel = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Channel(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SkypeChannelProperties.FromJson(__jsonProperties) : Property;} + __channel = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Channel(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.SkypeChannelProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SkypeChannelProperties.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/SkypeChannelProperties.PowerShell.cs similarity index 56% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SkypeChannelProperties.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/SkypeChannelProperties.PowerShell.cs index ae37d20f23f0..7d8655f4ba45 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SkypeChannelProperties.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/SkypeChannelProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class SkypeChannelProperties 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.BotService.Models.Api20220615Preview.ISkypeChannelProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new SkypeChannelProperties(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.BotService.Models.Api20220615Preview.ISkypeChannelProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new SkypeChannelProperties(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Pr /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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,49 +111,49 @@ internal SkypeChannelProperties(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("EnableMessaging")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelPropertiesInternal)this).EnableMessaging = (bool?) content.GetValueForProperty("EnableMessaging",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelPropertiesInternal)this).EnableMessaging, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelPropertiesInternal)this).EnableMessaging = (bool?) content.GetValueForProperty("EnableMessaging",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelPropertiesInternal)this).EnableMessaging, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("EnableMediaCard")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelPropertiesInternal)this).EnableMediaCard = (bool?) content.GetValueForProperty("EnableMediaCard",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelPropertiesInternal)this).EnableMediaCard, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelPropertiesInternal)this).EnableMediaCard = (bool?) content.GetValueForProperty("EnableMediaCard",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelPropertiesInternal)this).EnableMediaCard, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("EnableVideo")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelPropertiesInternal)this).EnableVideo = (bool?) content.GetValueForProperty("EnableVideo",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelPropertiesInternal)this).EnableVideo, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelPropertiesInternal)this).EnableVideo = (bool?) content.GetValueForProperty("EnableVideo",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelPropertiesInternal)this).EnableVideo, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("EnableCalling")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelPropertiesInternal)this).EnableCalling = (bool?) content.GetValueForProperty("EnableCalling",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelPropertiesInternal)this).EnableCalling, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelPropertiesInternal)this).EnableCalling = (bool?) content.GetValueForProperty("EnableCalling",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelPropertiesInternal)this).EnableCalling, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("EnableScreenSharing")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelPropertiesInternal)this).EnableScreenSharing = (bool?) content.GetValueForProperty("EnableScreenSharing",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelPropertiesInternal)this).EnableScreenSharing, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelPropertiesInternal)this).EnableScreenSharing = (bool?) content.GetValueForProperty("EnableScreenSharing",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelPropertiesInternal)this).EnableScreenSharing, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("EnableGroup")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelPropertiesInternal)this).EnableGroup = (bool?) content.GetValueForProperty("EnableGroup",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelPropertiesInternal)this).EnableGroup, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelPropertiesInternal)this).EnableGroup = (bool?) content.GetValueForProperty("EnableGroup",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelPropertiesInternal)this).EnableGroup, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("GroupsMode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelPropertiesInternal)this).GroupsMode = (string) content.GetValueForProperty("GroupsMode",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelPropertiesInternal)this).GroupsMode, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelPropertiesInternal)this).GroupsMode = (string) content.GetValueForProperty("GroupsMode",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelPropertiesInternal)this).GroupsMode, global::System.Convert.ToString); } if (content.Contains("CallingWebHook")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelPropertiesInternal)this).CallingWebHook = (string) content.GetValueForProperty("CallingWebHook",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelPropertiesInternal)this).CallingWebHook, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelPropertiesInternal)this).CallingWebHook = (string) content.GetValueForProperty("CallingWebHook",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelPropertiesInternal)this).CallingWebHook, global::System.Convert.ToString); } if (content.Contains("IncomingCallRoute")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelPropertiesInternal)this).IncomingCallRoute = (string) content.GetValueForProperty("IncomingCallRoute",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelPropertiesInternal)this).IncomingCallRoute, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelPropertiesInternal)this).IncomingCallRoute = (string) content.GetValueForProperty("IncomingCallRoute",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelPropertiesInternal)this).IncomingCallRoute, global::System.Convert.ToString); } if (content.Contains("IsEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelPropertiesInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelPropertiesInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelPropertiesInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelPropertiesInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -162,43 +168,43 @@ internal SkypeChannelProperties(global::System.Management.Automation.PSObject co // actually deserialize if (content.Contains("EnableMessaging")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelPropertiesInternal)this).EnableMessaging = (bool?) content.GetValueForProperty("EnableMessaging",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelPropertiesInternal)this).EnableMessaging, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelPropertiesInternal)this).EnableMessaging = (bool?) content.GetValueForProperty("EnableMessaging",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelPropertiesInternal)this).EnableMessaging, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("EnableMediaCard")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelPropertiesInternal)this).EnableMediaCard = (bool?) content.GetValueForProperty("EnableMediaCard",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelPropertiesInternal)this).EnableMediaCard, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelPropertiesInternal)this).EnableMediaCard = (bool?) content.GetValueForProperty("EnableMediaCard",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelPropertiesInternal)this).EnableMediaCard, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("EnableVideo")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelPropertiesInternal)this).EnableVideo = (bool?) content.GetValueForProperty("EnableVideo",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelPropertiesInternal)this).EnableVideo, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelPropertiesInternal)this).EnableVideo = (bool?) content.GetValueForProperty("EnableVideo",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelPropertiesInternal)this).EnableVideo, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("EnableCalling")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelPropertiesInternal)this).EnableCalling = (bool?) content.GetValueForProperty("EnableCalling",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelPropertiesInternal)this).EnableCalling, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelPropertiesInternal)this).EnableCalling = (bool?) content.GetValueForProperty("EnableCalling",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelPropertiesInternal)this).EnableCalling, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("EnableScreenSharing")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelPropertiesInternal)this).EnableScreenSharing = (bool?) content.GetValueForProperty("EnableScreenSharing",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelPropertiesInternal)this).EnableScreenSharing, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelPropertiesInternal)this).EnableScreenSharing = (bool?) content.GetValueForProperty("EnableScreenSharing",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelPropertiesInternal)this).EnableScreenSharing, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("EnableGroup")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelPropertiesInternal)this).EnableGroup = (bool?) content.GetValueForProperty("EnableGroup",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelPropertiesInternal)this).EnableGroup, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelPropertiesInternal)this).EnableGroup = (bool?) content.GetValueForProperty("EnableGroup",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelPropertiesInternal)this).EnableGroup, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("GroupsMode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelPropertiesInternal)this).GroupsMode = (string) content.GetValueForProperty("GroupsMode",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelPropertiesInternal)this).GroupsMode, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelPropertiesInternal)this).GroupsMode = (string) content.GetValueForProperty("GroupsMode",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelPropertiesInternal)this).GroupsMode, global::System.Convert.ToString); } if (content.Contains("CallingWebHook")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelPropertiesInternal)this).CallingWebHook = (string) content.GetValueForProperty("CallingWebHook",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelPropertiesInternal)this).CallingWebHook, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelPropertiesInternal)this).CallingWebHook = (string) content.GetValueForProperty("CallingWebHook",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelPropertiesInternal)this).CallingWebHook, global::System.Convert.ToString); } if (content.Contains("IncomingCallRoute")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelPropertiesInternal)this).IncomingCallRoute = (string) content.GetValueForProperty("IncomingCallRoute",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelPropertiesInternal)this).IncomingCallRoute, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelPropertiesInternal)this).IncomingCallRoute = (string) content.GetValueForProperty("IncomingCallRoute",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelPropertiesInternal)this).IncomingCallRoute, global::System.Convert.ToString); } if (content.Contains("IsEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelPropertiesInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelPropertiesInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelPropertiesInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelPropertiesInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializePSObject(content); } @@ -207,6 +213,18 @@ internal SkypeChannelProperties(global::System.Management.Automation.PSObject co /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.BotService.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 parameters to provide for the Microsoft Teams channel. [System.ComponentModel.TypeConverter(typeof(SkypeChannelPropertiesTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SkypeChannelProperties.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/SkypeChannelProperties.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SkypeChannelProperties.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/SkypeChannelProperties.TypeConverter.cs index e11cc8765564..c5b051adfddf 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SkypeChannelProperties.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/SkypeChannelProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.ISkypeChannelProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SkypeChannelProperties.cs b/generated/BotService/BotService.Autorest/generated/api/Models/SkypeChannelProperties.cs similarity index 91% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SkypeChannelProperties.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/SkypeChannelProperties.cs index 92dfa1e590da..2b552ae04511 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SkypeChannelProperties.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/SkypeChannelProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// The parameters to provide for the Microsoft Teams channel. public partial class SkypeChannelProperties : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelProperties, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelProperties, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelPropertiesInternal { /// Backing field for property. @@ -97,6 +97,9 @@ public partial interface ISkypeChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Calling web hook for Skype channel", SerializedName = @"callingWebHook", PossibleTypes = new [] { typeof(string) })] @@ -105,6 +108,9 @@ public partial interface ISkypeChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Enable calling for Skype channel", SerializedName = @"enableCalling", PossibleTypes = new [] { typeof(bool) })] @@ -113,6 +119,9 @@ public partial interface ISkypeChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Enable groups for Skype channel", SerializedName = @"enableGroups", PossibleTypes = new [] { typeof(bool) })] @@ -121,6 +130,9 @@ public partial interface ISkypeChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Enable media cards for Skype channel", SerializedName = @"enableMediaCards", PossibleTypes = new [] { typeof(bool) })] @@ -129,6 +141,9 @@ public partial interface ISkypeChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Enable messaging for Skype channel", SerializedName = @"enableMessaging", PossibleTypes = new [] { typeof(bool) })] @@ -137,6 +152,9 @@ public partial interface ISkypeChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Enable screen sharing for Skype channel", SerializedName = @"enableScreenSharing", PossibleTypes = new [] { typeof(bool) })] @@ -145,6 +163,9 @@ public partial interface ISkypeChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Enable video for Skype channel", SerializedName = @"enableVideo", PossibleTypes = new [] { typeof(bool) })] @@ -153,6 +174,9 @@ public partial interface ISkypeChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Group mode for Skype channel", SerializedName = @"groupsMode", PossibleTypes = new [] { typeof(string) })] @@ -161,6 +185,9 @@ public partial interface ISkypeChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Incoming call route for Skype channel", SerializedName = @"incomingCallRoute", PossibleTypes = new [] { typeof(string) })] @@ -169,6 +196,9 @@ public partial interface ISkypeChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Whether this channel is enabled for the bot", SerializedName = @"isEnabled", PossibleTypes = new [] { typeof(bool) })] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SkypeChannelProperties.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/SkypeChannelProperties.json.cs similarity index 93% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SkypeChannelProperties.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/SkypeChannelProperties.json.cs index 25fb451b1cca..de342a7644a2 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SkypeChannelProperties.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/SkypeChannelProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class SkypeChannelProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISkypeChannelProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISkypeChannelProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new SkypeChannelProperties(json) : null; } @@ -77,16 +77,16 @@ internal SkypeChannelProperties(Microsoft.Azure.PowerShell.Cmdlets.BotService.Ru { return; } - {_enableMessaging = If( json?.PropertyT("enableMessaging"), out var __jsonEnableMessaging) ? (bool?)__jsonEnableMessaging : EnableMessaging;} - {_enableMediaCard = If( json?.PropertyT("enableMediaCards"), out var __jsonEnableMediaCards) ? (bool?)__jsonEnableMediaCards : EnableMediaCard;} - {_enableVideo = If( json?.PropertyT("enableVideo"), out var __jsonEnableVideo) ? (bool?)__jsonEnableVideo : EnableVideo;} - {_enableCalling = If( json?.PropertyT("enableCalling"), out var __jsonEnableCalling) ? (bool?)__jsonEnableCalling : EnableCalling;} - {_enableScreenSharing = If( json?.PropertyT("enableScreenSharing"), out var __jsonEnableScreenSharing) ? (bool?)__jsonEnableScreenSharing : EnableScreenSharing;} - {_enableGroup = If( json?.PropertyT("enableGroups"), out var __jsonEnableGroups) ? (bool?)__jsonEnableGroups : EnableGroup;} - {_groupsMode = If( json?.PropertyT("groupsMode"), out var __jsonGroupsMode) ? (string)__jsonGroupsMode : (string)GroupsMode;} - {_callingWebHook = If( json?.PropertyT("callingWebHook"), out var __jsonCallingWebHook) ? (string)__jsonCallingWebHook : (string)CallingWebHook;} - {_incomingCallRoute = If( json?.PropertyT("incomingCallRoute"), out var __jsonIncomingCallRoute) ? (string)__jsonIncomingCallRoute : (string)IncomingCallRoute;} - {_isEnabled = If( json?.PropertyT("isEnabled"), out var __jsonIsEnabled) ? (bool)__jsonIsEnabled : IsEnabled;} + {_enableMessaging = If( json?.PropertyT("enableMessaging"), out var __jsonEnableMessaging) ? (bool?)__jsonEnableMessaging : _enableMessaging;} + {_enableMediaCard = If( json?.PropertyT("enableMediaCards"), out var __jsonEnableMediaCards) ? (bool?)__jsonEnableMediaCards : _enableMediaCard;} + {_enableVideo = If( json?.PropertyT("enableVideo"), out var __jsonEnableVideo) ? (bool?)__jsonEnableVideo : _enableVideo;} + {_enableCalling = If( json?.PropertyT("enableCalling"), out var __jsonEnableCalling) ? (bool?)__jsonEnableCalling : _enableCalling;} + {_enableScreenSharing = If( json?.PropertyT("enableScreenSharing"), out var __jsonEnableScreenSharing) ? (bool?)__jsonEnableScreenSharing : _enableScreenSharing;} + {_enableGroup = If( json?.PropertyT("enableGroups"), out var __jsonEnableGroups) ? (bool?)__jsonEnableGroups : _enableGroup;} + {_groupsMode = If( json?.PropertyT("groupsMode"), out var __jsonGroupsMode) ? (string)__jsonGroupsMode : (string)_groupsMode;} + {_callingWebHook = If( json?.PropertyT("callingWebHook"), out var __jsonCallingWebHook) ? (string)__jsonCallingWebHook : (string)_callingWebHook;} + {_incomingCallRoute = If( json?.PropertyT("incomingCallRoute"), out var __jsonIncomingCallRoute) ? (string)__jsonIncomingCallRoute : (string)_incomingCallRoute;} + {_isEnabled = If( json?.PropertyT("isEnabled"), out var __jsonIsEnabled) ? (bool)__jsonIsEnabled : _isEnabled;} AfterFromJson(json); } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SlackChannel.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/SlackChannel.PowerShell.cs similarity index 52% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SlackChannel.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/SlackChannel.PowerShell.cs index c34aebb8ddfc..923eb908287d 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SlackChannel.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/SlackChannel.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class SlackChannel 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.BotService.Models.Api20220615Preview.ISlackChannel DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannel DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new SlackChannel(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.BotService.Models.Api20220615Preview.ISlackChannel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new SlackChannel(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Pr /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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. @@ -103,73 +111,73 @@ internal SlackChannel(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SlackChannelPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.SlackChannelPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Etag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Etag, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Etag, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).ProvisioningState, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("ClientId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelInternal)this).ClientId = (string) content.GetValueForProperty("ClientId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelInternal)this).ClientId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelInternal)this).ClientId = (string) content.GetValueForProperty("ClientId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelInternal)this).ClientId, global::System.Convert.ToString); } if (content.Contains("ClientSecret")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelInternal)this).ClientSecret = (string) content.GetValueForProperty("ClientSecret",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelInternal)this).ClientSecret, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelInternal)this).ClientSecret = (string) content.GetValueForProperty("ClientSecret",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelInternal)this).ClientSecret, global::System.Convert.ToString); } if (content.Contains("VerificationToken")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelInternal)this).VerificationToken = (string) content.GetValueForProperty("VerificationToken",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelInternal)this).VerificationToken, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelInternal)this).VerificationToken = (string) content.GetValueForProperty("VerificationToken",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelInternal)this).VerificationToken, global::System.Convert.ToString); } if (content.Contains("Scope")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelInternal)this).Scope, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelInternal)this).Scope, global::System.Convert.ToString); } if (content.Contains("LandingPageUrl")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelInternal)this).LandingPageUrl = (string) content.GetValueForProperty("LandingPageUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelInternal)this).LandingPageUrl, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelInternal)this).LandingPageUrl = (string) content.GetValueForProperty("LandingPageUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelInternal)this).LandingPageUrl, global::System.Convert.ToString); } if (content.Contains("RedirectAction")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelInternal)this).RedirectAction = (string) content.GetValueForProperty("RedirectAction",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelInternal)this).RedirectAction, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelInternal)this).RedirectAction = (string) content.GetValueForProperty("RedirectAction",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelInternal)this).RedirectAction, global::System.Convert.ToString); } if (content.Contains("LastSubmissionId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelInternal)this).LastSubmissionId = (string) content.GetValueForProperty("LastSubmissionId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelInternal)this).LastSubmissionId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelInternal)this).LastSubmissionId = (string) content.GetValueForProperty("LastSubmissionId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelInternal)this).LastSubmissionId, global::System.Convert.ToString); } if (content.Contains("RegisterBeforeOAuthFlow")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelInternal)this).RegisterBeforeOAuthFlow = (bool?) content.GetValueForProperty("RegisterBeforeOAuthFlow",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelInternal)this).RegisterBeforeOAuthFlow, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelInternal)this).RegisterBeforeOAuthFlow = (bool?) content.GetValueForProperty("RegisterBeforeOAuthFlow",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelInternal)this).RegisterBeforeOAuthFlow, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsValidated")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelInternal)this).IsValidated = (bool?) content.GetValueForProperty("IsValidated",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelInternal)this).IsValidated, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelInternal)this).IsValidated = (bool?) content.GetValueForProperty("IsValidated",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelInternal)this).IsValidated, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("SigningSecret")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelInternal)this).SigningSecret = (string) content.GetValueForProperty("SigningSecret",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelInternal)this).SigningSecret, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelInternal)this).SigningSecret = (string) content.GetValueForProperty("SigningSecret",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelInternal)this).SigningSecret, global::System.Convert.ToString); } if (content.Contains("IsEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelInternal)this).IsEnabled = (bool?) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelInternal)this).IsEnabled, (__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. @@ -184,67 +192,67 @@ internal SlackChannel(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SlackChannelPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.SlackChannelPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Etag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Etag, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Etag, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).ProvisioningState, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("ClientId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelInternal)this).ClientId = (string) content.GetValueForProperty("ClientId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelInternal)this).ClientId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelInternal)this).ClientId = (string) content.GetValueForProperty("ClientId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelInternal)this).ClientId, global::System.Convert.ToString); } if (content.Contains("ClientSecret")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelInternal)this).ClientSecret = (string) content.GetValueForProperty("ClientSecret",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelInternal)this).ClientSecret, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelInternal)this).ClientSecret = (string) content.GetValueForProperty("ClientSecret",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelInternal)this).ClientSecret, global::System.Convert.ToString); } if (content.Contains("VerificationToken")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelInternal)this).VerificationToken = (string) content.GetValueForProperty("VerificationToken",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelInternal)this).VerificationToken, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelInternal)this).VerificationToken = (string) content.GetValueForProperty("VerificationToken",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelInternal)this).VerificationToken, global::System.Convert.ToString); } if (content.Contains("Scope")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelInternal)this).Scope, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelInternal)this).Scope, global::System.Convert.ToString); } if (content.Contains("LandingPageUrl")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelInternal)this).LandingPageUrl = (string) content.GetValueForProperty("LandingPageUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelInternal)this).LandingPageUrl, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelInternal)this).LandingPageUrl = (string) content.GetValueForProperty("LandingPageUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelInternal)this).LandingPageUrl, global::System.Convert.ToString); } if (content.Contains("RedirectAction")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelInternal)this).RedirectAction = (string) content.GetValueForProperty("RedirectAction",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelInternal)this).RedirectAction, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelInternal)this).RedirectAction = (string) content.GetValueForProperty("RedirectAction",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelInternal)this).RedirectAction, global::System.Convert.ToString); } if (content.Contains("LastSubmissionId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelInternal)this).LastSubmissionId = (string) content.GetValueForProperty("LastSubmissionId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelInternal)this).LastSubmissionId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelInternal)this).LastSubmissionId = (string) content.GetValueForProperty("LastSubmissionId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelInternal)this).LastSubmissionId, global::System.Convert.ToString); } if (content.Contains("RegisterBeforeOAuthFlow")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelInternal)this).RegisterBeforeOAuthFlow = (bool?) content.GetValueForProperty("RegisterBeforeOAuthFlow",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelInternal)this).RegisterBeforeOAuthFlow, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelInternal)this).RegisterBeforeOAuthFlow = (bool?) content.GetValueForProperty("RegisterBeforeOAuthFlow",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelInternal)this).RegisterBeforeOAuthFlow, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsValidated")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelInternal)this).IsValidated = (bool?) content.GetValueForProperty("IsValidated",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelInternal)this).IsValidated, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelInternal)this).IsValidated = (bool?) content.GetValueForProperty("IsValidated",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelInternal)this).IsValidated, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("SigningSecret")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelInternal)this).SigningSecret = (string) content.GetValueForProperty("SigningSecret",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelInternal)this).SigningSecret, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelInternal)this).SigningSecret = (string) content.GetValueForProperty("SigningSecret",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelInternal)this).SigningSecret, global::System.Convert.ToString); } if (content.Contains("IsEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelInternal)this).IsEnabled = (bool?) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializePSObject(content); } @@ -253,6 +261,18 @@ internal SlackChannel(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.BotService.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(); + } } /// Slack channel definition [System.ComponentModel.TypeConverter(typeof(SlackChannelTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SlackChannel.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/SlackChannel.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SlackChannel.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/SlackChannel.TypeConverter.cs index 0b31112be5a8..cb1bc35f99b5 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SlackChannel.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/SlackChannel.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.ISlackChannel ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannel ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannel).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannel).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SlackChannel.cs b/generated/BotService/BotService.Autorest/generated/api/Models/SlackChannel.cs similarity index 68% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SlackChannel.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/SlackChannel.cs index ff592b020d67..9a655941e48e 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SlackChannel.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/SlackChannel.cs @@ -3,114 +3,114 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// Slack channel definition public partial class SlackChannel : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannel, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelInternal, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannel, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelInternal, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannel __channel = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Channel(); + private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannel __channel = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Channel(); /// The Slack client id [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string ClientId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)Property).ClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)Property).ClientId = value ?? null; } + public string ClientId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)Property).ClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)Property).ClientId = value ?? null; } /// /// The Slack client secret. Value only returned through POST to the action Channel List API, otherwise empty. /// [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string ClientSecret { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)Property).ClientSecret; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)Property).ClientSecret = value ?? null; } + public string ClientSecret { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)Property).ClientSecret; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)Property).ClientSecret = value ?? null; } /// Entity Tag of the resource [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Etag = value ?? null; } + public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Etag = value ?? null; } /// Whether this channel is enabled for the bot [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public bool? IsEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)Property).IsEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)Property).IsEnabled = value ?? default(bool); } + public bool? IsEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)Property).IsEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)Property).IsEnabled = value ?? default(bool); } /// Whether this channel is validated for the bot [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public bool? IsValidated { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)Property).IsValidated; } + public bool? IsValidated { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)Property).IsValidated; } /// The Slack landing page Url [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string LandingPageUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)Property).LandingPageUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)Property).LandingPageUrl = value ?? null; } + public string LandingPageUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)Property).LandingPageUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)Property).LandingPageUrl = value ?? null; } /// The Sms auth token [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string LastSubmissionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)Property).LastSubmissionId; } + public string LastSubmissionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)Property).LastSubmissionId; } /// Specifies the location of the resource. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Location = value ?? null; } + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Location = value ?? null; } /// Internal Acessors for ProvisioningState - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).ProvisioningState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).ProvisioningState = value; } /// Internal Acessors for IsValidated - bool? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelInternal.IsValidated { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)Property).IsValidated; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)Property).IsValidated = value; } + bool? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelInternal.IsValidated { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)Property).IsValidated; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)Property).IsValidated = value; } /// Internal Acessors for LastSubmissionId - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelInternal.LastSubmissionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)Property).LastSubmissionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)Property).LastSubmissionId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelInternal.LastSubmissionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)Property).LastSubmissionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)Property).LastSubmissionId = value; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelProperties Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SlackChannelProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelProperties Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.SlackChannelProperties()); set { {_property = value;} } } /// Internal Acessors for RedirectAction - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelInternal.RedirectAction { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)Property).RedirectAction; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)Property).RedirectAction = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelInternal.RedirectAction { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)Property).RedirectAction; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)Property).RedirectAction = value; } /// The channel name + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Constant] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Name = value ; } + public string Name { get => "SlackChannel"; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Name = "SlackChannel"; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelProperties _property; /// The set of properties specific to Slack channel resource [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SlackChannelProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.SlackChannelProperties()); set => this._property = value; } /// Provisioning state of the resource [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).ProvisioningState; } + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).ProvisioningState; } /// The Slack redirect action [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string RedirectAction { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)Property).RedirectAction; } + public string RedirectAction { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)Property).RedirectAction; } /// /// Whether to register the settings before OAuth validation is performed. Recommended to True. /// [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public bool? RegisterBeforeOAuthFlow { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)Property).RegisterBeforeOAuthFlow; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)Property).RegisterBeforeOAuthFlow = value ?? default(bool); } + public bool? RegisterBeforeOAuthFlow { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)Property).RegisterBeforeOAuthFlow; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)Property).RegisterBeforeOAuthFlow = value ?? default(bool); } /// The Slack permission scopes. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)Property).Scope = value ?? null; } + public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)Property).Scope = value ?? null; } /// The Slack signing secret. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string SigningSecret { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)Property).SigningSecret; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)Property).SigningSecret = value ?? null; } + public string SigningSecret { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)Property).SigningSecret; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)Property).SigningSecret = value ?? null; } /// /// The Slack verification token. Value only returned through POST to the action Channel List API, otherwise empty. /// [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string VerificationToken { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)Property).VerificationToken; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)Property).VerificationToken = value ?? null; } + public string VerificationToken { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)Property).VerificationToken; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)Property).VerificationToken = value ?? null; } /// Creates an new instance. public SlackChannel() { - + this.__channel.Name = "SlackChannel"; } /// Validates that this object meets the validation criteria. @@ -128,12 +128,15 @@ public SlackChannel() /// Slack channel definition public partial interface ISlackChannel : Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannel + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannel { /// The Slack client id [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The Slack client id", SerializedName = @"clientId", PossibleTypes = new [] { typeof(string) })] @@ -144,6 +147,9 @@ public partial interface ISlackChannel : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The Slack client secret. Value only returned through POST to the action Channel List API, otherwise empty.", SerializedName = @"clientSecret", PossibleTypes = new [] { typeof(string) })] @@ -152,6 +158,9 @@ public partial interface ISlackChannel : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Whether this channel is enabled for the bot", SerializedName = @"isEnabled", PossibleTypes = new [] { typeof(bool) })] @@ -160,6 +169,9 @@ public partial interface ISlackChannel : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Whether this channel is validated for the bot", SerializedName = @"IsValidated", PossibleTypes = new [] { typeof(bool) })] @@ -168,6 +180,9 @@ public partial interface ISlackChannel : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The Slack landing page Url", SerializedName = @"landingPageUrl", PossibleTypes = new [] { typeof(string) })] @@ -176,6 +191,9 @@ public partial interface ISlackChannel : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The Sms auth token", SerializedName = @"lastSubmissionId", PossibleTypes = new [] { typeof(string) })] @@ -184,6 +202,9 @@ public partial interface ISlackChannel : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The Slack redirect action", SerializedName = @"redirectAction", PossibleTypes = new [] { typeof(string) })] @@ -194,6 +215,9 @@ public partial interface ISlackChannel : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Whether to register the settings before OAuth validation is performed. Recommended to True.", SerializedName = @"registerBeforeOAuthFlow", PossibleTypes = new [] { typeof(bool) })] @@ -202,6 +226,9 @@ public partial interface ISlackChannel : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The Slack permission scopes.", SerializedName = @"scopes", PossibleTypes = new [] { typeof(string) })] @@ -210,6 +237,9 @@ public partial interface ISlackChannel : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The Slack signing secret.", SerializedName = @"signingSecret", PossibleTypes = new [] { typeof(string) })] @@ -220,6 +250,9 @@ public partial interface ISlackChannel : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The Slack verification token. Value only returned through POST to the action Channel List API, otherwise empty.", SerializedName = @"verificationToken", PossibleTypes = new [] { typeof(string) })] @@ -228,7 +261,7 @@ public partial interface ISlackChannel : } /// Slack channel definition internal partial interface ISlackChannelInternal : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal { /// The Slack client id string ClientId { get; set; } @@ -245,7 +278,7 @@ internal partial interface ISlackChannelInternal : /// The Sms auth token string LastSubmissionId { get; set; } /// The set of properties specific to Slack channel resource - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelProperties Property { get; set; } /// The Slack redirect action string RedirectAction { get; set; } /// diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SlackChannel.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/SlackChannel.json.cs similarity index 93% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SlackChannel.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/SlackChannel.json.cs index da0f044ab4a7..a743cdd47c10 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SlackChannel.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/SlackChannel.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class SlackChannel partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannel. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannel. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannel. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannel. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannel FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannel FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new SlackChannel(json) : null; } @@ -77,8 +77,8 @@ internal SlackChannel(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json { return; } - __channel = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Channel(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SlackChannelProperties.FromJson(__jsonProperties) : Property;} + __channel = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Channel(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.SlackChannelProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SlackChannelProperties.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/SlackChannelProperties.PowerShell.cs similarity index 56% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SlackChannelProperties.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/SlackChannelProperties.PowerShell.cs index 37409f8ecb72..e59930f3d641 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SlackChannelProperties.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/SlackChannelProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class SlackChannelProperties 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.BotService.Models.Api20220615Preview.ISlackChannelProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new SlackChannelProperties(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.BotService.Models.Api20220615Preview.ISlackChannelProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new SlackChannelProperties(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Pr /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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,53 +111,53 @@ internal SlackChannelProperties(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("ClientId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)this).ClientId = (string) content.GetValueForProperty("ClientId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)this).ClientId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)this).ClientId = (string) content.GetValueForProperty("ClientId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)this).ClientId, global::System.Convert.ToString); } if (content.Contains("ClientSecret")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)this).ClientSecret = (string) content.GetValueForProperty("ClientSecret",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)this).ClientSecret, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)this).ClientSecret = (string) content.GetValueForProperty("ClientSecret",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)this).ClientSecret, global::System.Convert.ToString); } if (content.Contains("VerificationToken")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)this).VerificationToken = (string) content.GetValueForProperty("VerificationToken",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)this).VerificationToken, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)this).VerificationToken = (string) content.GetValueForProperty("VerificationToken",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)this).VerificationToken, global::System.Convert.ToString); } if (content.Contains("Scope")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)this).Scope, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)this).Scope, global::System.Convert.ToString); } if (content.Contains("LandingPageUrl")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)this).LandingPageUrl = (string) content.GetValueForProperty("LandingPageUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)this).LandingPageUrl, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)this).LandingPageUrl = (string) content.GetValueForProperty("LandingPageUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)this).LandingPageUrl, global::System.Convert.ToString); } if (content.Contains("RedirectAction")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)this).RedirectAction = (string) content.GetValueForProperty("RedirectAction",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)this).RedirectAction, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)this).RedirectAction = (string) content.GetValueForProperty("RedirectAction",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)this).RedirectAction, global::System.Convert.ToString); } if (content.Contains("LastSubmissionId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)this).LastSubmissionId = (string) content.GetValueForProperty("LastSubmissionId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)this).LastSubmissionId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)this).LastSubmissionId = (string) content.GetValueForProperty("LastSubmissionId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)this).LastSubmissionId, global::System.Convert.ToString); } if (content.Contains("RegisterBeforeOAuthFlow")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)this).RegisterBeforeOAuthFlow = (bool?) content.GetValueForProperty("RegisterBeforeOAuthFlow",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)this).RegisterBeforeOAuthFlow, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)this).RegisterBeforeOAuthFlow = (bool?) content.GetValueForProperty("RegisterBeforeOAuthFlow",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)this).RegisterBeforeOAuthFlow, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsValidated")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)this).IsValidated = (bool?) content.GetValueForProperty("IsValidated",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)this).IsValidated, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)this).IsValidated = (bool?) content.GetValueForProperty("IsValidated",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)this).IsValidated, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("SigningSecret")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)this).SigningSecret = (string) content.GetValueForProperty("SigningSecret",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)this).SigningSecret, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)this).SigningSecret = (string) content.GetValueForProperty("SigningSecret",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)this).SigningSecret, global::System.Convert.ToString); } if (content.Contains("IsEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)this).IsEnabled, (__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. @@ -166,47 +172,47 @@ internal SlackChannelProperties(global::System.Management.Automation.PSObject co // actually deserialize if (content.Contains("ClientId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)this).ClientId = (string) content.GetValueForProperty("ClientId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)this).ClientId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)this).ClientId = (string) content.GetValueForProperty("ClientId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)this).ClientId, global::System.Convert.ToString); } if (content.Contains("ClientSecret")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)this).ClientSecret = (string) content.GetValueForProperty("ClientSecret",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)this).ClientSecret, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)this).ClientSecret = (string) content.GetValueForProperty("ClientSecret",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)this).ClientSecret, global::System.Convert.ToString); } if (content.Contains("VerificationToken")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)this).VerificationToken = (string) content.GetValueForProperty("VerificationToken",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)this).VerificationToken, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)this).VerificationToken = (string) content.GetValueForProperty("VerificationToken",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)this).VerificationToken, global::System.Convert.ToString); } if (content.Contains("Scope")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)this).Scope, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)this).Scope, global::System.Convert.ToString); } if (content.Contains("LandingPageUrl")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)this).LandingPageUrl = (string) content.GetValueForProperty("LandingPageUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)this).LandingPageUrl, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)this).LandingPageUrl = (string) content.GetValueForProperty("LandingPageUrl",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)this).LandingPageUrl, global::System.Convert.ToString); } if (content.Contains("RedirectAction")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)this).RedirectAction = (string) content.GetValueForProperty("RedirectAction",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)this).RedirectAction, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)this).RedirectAction = (string) content.GetValueForProperty("RedirectAction",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)this).RedirectAction, global::System.Convert.ToString); } if (content.Contains("LastSubmissionId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)this).LastSubmissionId = (string) content.GetValueForProperty("LastSubmissionId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)this).LastSubmissionId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)this).LastSubmissionId = (string) content.GetValueForProperty("LastSubmissionId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)this).LastSubmissionId, global::System.Convert.ToString); } if (content.Contains("RegisterBeforeOAuthFlow")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)this).RegisterBeforeOAuthFlow = (bool?) content.GetValueForProperty("RegisterBeforeOAuthFlow",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)this).RegisterBeforeOAuthFlow, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)this).RegisterBeforeOAuthFlow = (bool?) content.GetValueForProperty("RegisterBeforeOAuthFlow",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)this).RegisterBeforeOAuthFlow, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsValidated")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)this).IsValidated = (bool?) content.GetValueForProperty("IsValidated",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)this).IsValidated, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)this).IsValidated = (bool?) content.GetValueForProperty("IsValidated",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)this).IsValidated, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("SigningSecret")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)this).SigningSecret = (string) content.GetValueForProperty("SigningSecret",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)this).SigningSecret, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)this).SigningSecret = (string) content.GetValueForProperty("SigningSecret",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)this).SigningSecret, global::System.Convert.ToString); } if (content.Contains("IsEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializePSObject(content); } @@ -215,6 +221,18 @@ internal SlackChannelProperties(global::System.Management.Automation.PSObject co /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.BotService.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 parameters to provide for the Slack channel. [System.ComponentModel.TypeConverter(typeof(SlackChannelPropertiesTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SlackChannelProperties.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/SlackChannelProperties.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SlackChannelProperties.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/SlackChannelProperties.TypeConverter.cs index fc1905451e4f..59ab698d8964 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SlackChannelProperties.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/SlackChannelProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.ISlackChannelProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SlackChannelProperties.cs b/generated/BotService/BotService.Autorest/generated/api/Models/SlackChannelProperties.cs similarity index 90% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SlackChannelProperties.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/SlackChannelProperties.cs index 661ecc654f94..bedb19a74d13 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SlackChannelProperties.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/SlackChannelProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// The parameters to provide for the Slack channel. public partial class SlackChannelProperties : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelProperties, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelProperties, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal { /// Backing field for property. @@ -58,13 +58,13 @@ public partial class SlackChannelProperties : public string LastSubmissionId { get => this._lastSubmissionId; } /// Internal Acessors for IsValidated - bool? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal.IsValidated { get => this._isValidated; set { {_isValidated = value;} } } + bool? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal.IsValidated { get => this._isValidated; set { {_isValidated = value;} } } /// Internal Acessors for LastSubmissionId - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal.LastSubmissionId { get => this._lastSubmissionId; set { {_lastSubmissionId = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal.LastSubmissionId { get => this._lastSubmissionId; set { {_lastSubmissionId = value;} } } /// Internal Acessors for RedirectAction - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelPropertiesInternal.RedirectAction { get => this._redirectAction; set { {_redirectAction = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelPropertiesInternal.RedirectAction { get => this._redirectAction; set { {_redirectAction = value;} } } /// Backing field for property. private string _redirectAction; @@ -119,6 +119,9 @@ public partial interface ISlackChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The Slack client id", SerializedName = @"clientId", PossibleTypes = new [] { typeof(string) })] @@ -129,6 +132,9 @@ public partial interface ISlackChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The Slack client secret. Value only returned through POST to the action Channel List API, otherwise empty.", SerializedName = @"clientSecret", PossibleTypes = new [] { typeof(string) })] @@ -137,6 +143,9 @@ public partial interface ISlackChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Whether this channel is enabled for the bot", SerializedName = @"isEnabled", PossibleTypes = new [] { typeof(bool) })] @@ -145,6 +154,9 @@ public partial interface ISlackChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Whether this channel is validated for the bot", SerializedName = @"IsValidated", PossibleTypes = new [] { typeof(bool) })] @@ -153,6 +165,9 @@ public partial interface ISlackChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The Slack landing page Url", SerializedName = @"landingPageUrl", PossibleTypes = new [] { typeof(string) })] @@ -161,6 +176,9 @@ public partial interface ISlackChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The Sms auth token", SerializedName = @"lastSubmissionId", PossibleTypes = new [] { typeof(string) })] @@ -169,6 +187,9 @@ public partial interface ISlackChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The Slack redirect action", SerializedName = @"redirectAction", PossibleTypes = new [] { typeof(string) })] @@ -179,6 +200,9 @@ public partial interface ISlackChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Whether to register the settings before OAuth validation is performed. Recommended to True.", SerializedName = @"registerBeforeOAuthFlow", PossibleTypes = new [] { typeof(bool) })] @@ -187,6 +211,9 @@ public partial interface ISlackChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The Slack permission scopes.", SerializedName = @"scopes", PossibleTypes = new [] { typeof(string) })] @@ -195,6 +222,9 @@ public partial interface ISlackChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The Slack signing secret.", SerializedName = @"signingSecret", PossibleTypes = new [] { typeof(string) })] @@ -205,6 +235,9 @@ public partial interface ISlackChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The Slack verification token. Value only returned through POST to the action Channel List API, otherwise empty.", SerializedName = @"verificationToken", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SlackChannelProperties.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/SlackChannelProperties.json.cs similarity index 91% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SlackChannelProperties.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/SlackChannelProperties.json.cs index a3ead609858b..9b1a7ed7ff57 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SlackChannelProperties.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/SlackChannelProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class SlackChannelProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISlackChannelProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISlackChannelProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new SlackChannelProperties(json) : null; } @@ -77,17 +77,17 @@ internal SlackChannelProperties(Microsoft.Azure.PowerShell.Cmdlets.BotService.Ru { return; } - {_clientId = If( json?.PropertyT("clientId"), out var __jsonClientId) ? (string)__jsonClientId : (string)ClientId;} - {_clientSecret = If( json?.PropertyT("clientSecret"), out var __jsonClientSecret) ? (string)__jsonClientSecret : (string)ClientSecret;} - {_verificationToken = If( json?.PropertyT("verificationToken"), out var __jsonVerificationToken) ? (string)__jsonVerificationToken : (string)VerificationToken;} - {_scope = If( json?.PropertyT("scopes"), out var __jsonScopes) ? (string)__jsonScopes : (string)Scope;} - {_landingPageUrl = If( json?.PropertyT("landingPageUrl"), out var __jsonLandingPageUrl) ? (string)__jsonLandingPageUrl : (string)LandingPageUrl;} - {_redirectAction = If( json?.PropertyT("redirectAction"), out var __jsonRedirectAction) ? (string)__jsonRedirectAction : (string)RedirectAction;} - {_lastSubmissionId = If( json?.PropertyT("lastSubmissionId"), out var __jsonLastSubmissionId) ? (string)__jsonLastSubmissionId : (string)LastSubmissionId;} - {_registerBeforeOAuthFlow = If( json?.PropertyT("registerBeforeOAuthFlow"), out var __jsonRegisterBeforeOAuthFlow) ? (bool?)__jsonRegisterBeforeOAuthFlow : RegisterBeforeOAuthFlow;} - {_isValidated = If( json?.PropertyT("IsValidated"), out var __jsonIsValidated) ? (bool?)__jsonIsValidated : IsValidated;} - {_signingSecret = If( json?.PropertyT("signingSecret"), out var __jsonSigningSecret) ? (string)__jsonSigningSecret : (string)SigningSecret;} - {_isEnabled = If( json?.PropertyT("isEnabled"), out var __jsonIsEnabled) ? (bool)__jsonIsEnabled : IsEnabled;} + {_clientId = If( json?.PropertyT("clientId"), out var __jsonClientId) ? (string)__jsonClientId : (string)_clientId;} + {_clientSecret = If( json?.PropertyT("clientSecret"), out var __jsonClientSecret) ? (string)__jsonClientSecret : (string)_clientSecret;} + {_verificationToken = If( json?.PropertyT("verificationToken"), out var __jsonVerificationToken) ? (string)__jsonVerificationToken : (string)_verificationToken;} + {_scope = If( json?.PropertyT("scopes"), out var __jsonScopes) ? (string)__jsonScopes : (string)_scope;} + {_landingPageUrl = If( json?.PropertyT("landingPageUrl"), out var __jsonLandingPageUrl) ? (string)__jsonLandingPageUrl : (string)_landingPageUrl;} + {_redirectAction = If( json?.PropertyT("redirectAction"), out var __jsonRedirectAction) ? (string)__jsonRedirectAction : (string)_redirectAction;} + {_lastSubmissionId = If( json?.PropertyT("lastSubmissionId"), out var __jsonLastSubmissionId) ? (string)__jsonLastSubmissionId : (string)_lastSubmissionId;} + {_registerBeforeOAuthFlow = If( json?.PropertyT("registerBeforeOAuthFlow"), out var __jsonRegisterBeforeOAuthFlow) ? (bool?)__jsonRegisterBeforeOAuthFlow : _registerBeforeOAuthFlow;} + {_isValidated = If( json?.PropertyT("IsValidated"), out var __jsonIsValidated) ? (bool?)__jsonIsValidated : _isValidated;} + {_signingSecret = If( json?.PropertyT("signingSecret"), out var __jsonSigningSecret) ? (string)__jsonSigningSecret : (string)_signingSecret;} + {_isEnabled = If( json?.PropertyT("isEnabled"), out var __jsonIsEnabled) ? (bool)__jsonIsEnabled : _isEnabled;} AfterFromJson(json); } @@ -115,16 +115,16 @@ public Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode ToJso AddIf( null != (((object)this._verificationToken)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._verificationToken.ToString()) : null, "verificationToken" ,container.Add ); AddIf( null != (((object)this._scope)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._scope.ToString()) : null, "scopes" ,container.Add ); AddIf( null != (((object)this._landingPageUrl)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._landingPageUrl.ToString()) : null, "landingPageUrl" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._redirectAction)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._redirectAction.ToString()) : null, "redirectAction" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._lastSubmissionId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._lastSubmissionId.ToString()) : null, "lastSubmissionId" ,container.Add ); } AddIf( null != this._registerBeforeOAuthFlow ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonBoolean((bool)this._registerBeforeOAuthFlow) : null, "registerBeforeOAuthFlow" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._isValidated ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonBoolean((bool)this._isValidated) : null, "IsValidated" ,container.Add ); } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SmsChannel.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/SmsChannel.PowerShell.cs similarity index 59% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SmsChannel.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/SmsChannel.PowerShell.cs index 138d30c6b98e..18759e1b7410 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SmsChannel.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/SmsChannel.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class SmsChannel 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.BotService.Models.Api20220615Preview.ISmsChannel DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannel DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new SmsChannel(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.BotService.Models.Api20220615Preview.ISmsChannel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new SmsChannel(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Pr /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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. @@ -103,49 +111,49 @@ internal SmsChannel(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SmsChannelPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.SmsChannelPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Etag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Etag, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Etag, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).ProvisioningState, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("Phone")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelInternal)this).Phone = (string) content.GetValueForProperty("Phone",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelInternal)this).Phone, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelInternal)this).Phone = (string) content.GetValueForProperty("Phone",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelInternal)this).Phone, global::System.Convert.ToString); } if (content.Contains("AccountSid")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelInternal)this).AccountSid = (string) content.GetValueForProperty("AccountSid",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelInternal)this).AccountSid, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelInternal)this).AccountSid = (string) content.GetValueForProperty("AccountSid",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelInternal)this).AccountSid, global::System.Convert.ToString); } if (content.Contains("AuthToken")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelInternal)this).AuthToken = (string) content.GetValueForProperty("AuthToken",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelInternal)this).AuthToken, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelInternal)this).AuthToken = (string) content.GetValueForProperty("AuthToken",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelInternal)this).AuthToken, global::System.Convert.ToString); } if (content.Contains("IsValidated")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelInternal)this).IsValidated = (bool?) content.GetValueForProperty("IsValidated",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelInternal)this).IsValidated, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelInternal)this).IsValidated = (bool?) content.GetValueForProperty("IsValidated",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelInternal)this).IsValidated, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelInternal)this).IsEnabled = (bool?) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelInternal)this).IsEnabled, (__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. @@ -160,43 +168,43 @@ internal SmsChannel(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SmsChannelPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.SmsChannelPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Etag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Etag, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Etag, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).ProvisioningState, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("Phone")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelInternal)this).Phone = (string) content.GetValueForProperty("Phone",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelInternal)this).Phone, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelInternal)this).Phone = (string) content.GetValueForProperty("Phone",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelInternal)this).Phone, global::System.Convert.ToString); } if (content.Contains("AccountSid")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelInternal)this).AccountSid = (string) content.GetValueForProperty("AccountSid",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelInternal)this).AccountSid, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelInternal)this).AccountSid = (string) content.GetValueForProperty("AccountSid",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelInternal)this).AccountSid, global::System.Convert.ToString); } if (content.Contains("AuthToken")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelInternal)this).AuthToken = (string) content.GetValueForProperty("AuthToken",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelInternal)this).AuthToken, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelInternal)this).AuthToken = (string) content.GetValueForProperty("AuthToken",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelInternal)this).AuthToken, global::System.Convert.ToString); } if (content.Contains("IsValidated")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelInternal)this).IsValidated = (bool?) content.GetValueForProperty("IsValidated",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelInternal)this).IsValidated, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelInternal)this).IsValidated = (bool?) content.GetValueForProperty("IsValidated",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelInternal)this).IsValidated, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelInternal)this).IsEnabled = (bool?) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializePSObject(content); } @@ -205,6 +213,18 @@ internal SmsChannel(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.BotService.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(); + } } /// Sms channel definition [System.ComponentModel.TypeConverter(typeof(SmsChannelTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SmsChannel.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/SmsChannel.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SmsChannel.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/SmsChannel.TypeConverter.cs index 44b816c67a5e..697be5369a33 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SmsChannel.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/SmsChannel.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.ISmsChannel ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannel ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannel).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannel).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SmsChannel.cs b/generated/BotService/BotService.Autorest/generated/api/Models/SmsChannel.cs similarity index 67% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SmsChannel.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/SmsChannel.cs index 8bfa683ec17a..08fa437f5caf 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SmsChannel.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/SmsChannel.cs @@ -3,79 +3,79 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// Sms channel definition public partial class SmsChannel : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannel, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelInternal, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannel, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelInternal, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannel __channel = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Channel(); + private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannel __channel = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Channel(); /// /// The Sms account SID. Value only returned through POST to the action Channel List API, otherwise empty. /// [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string AccountSid { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelPropertiesInternal)Property).AccountSid; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelPropertiesInternal)Property).AccountSid = value ?? null; } + public string AccountSid { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelPropertiesInternal)Property).AccountSid; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelPropertiesInternal)Property).AccountSid = value ?? null; } /// /// The Sms auth token. Value only returned through POST to the action Channel List API, otherwise empty. /// [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string AuthToken { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelPropertiesInternal)Property).AuthToken; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelPropertiesInternal)Property).AuthToken = value ?? null; } + public string AuthToken { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelPropertiesInternal)Property).AuthToken; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelPropertiesInternal)Property).AuthToken = value ?? null; } /// Entity Tag of the resource [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Etag = value ?? null; } + public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Etag = value ?? null; } /// Whether this channel is enabled for the bot [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public bool? IsEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelPropertiesInternal)Property).IsEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelPropertiesInternal)Property).IsEnabled = value ?? default(bool); } + public bool? IsEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelPropertiesInternal)Property).IsEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelPropertiesInternal)Property).IsEnabled = value ?? default(bool); } /// Whether this channel is validated for the bot [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public bool? IsValidated { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelPropertiesInternal)Property).IsValidated; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelPropertiesInternal)Property).IsValidated = value ?? default(bool); } + public bool? IsValidated { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelPropertiesInternal)Property).IsValidated; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelPropertiesInternal)Property).IsValidated = value ?? default(bool); } /// Specifies the location of the resource. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Location = value ?? null; } + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Location = value ?? null; } /// Internal Acessors for ProvisioningState - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).ProvisioningState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).ProvisioningState = value; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelProperties Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SmsChannelProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelProperties Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.SmsChannelProperties()); set { {_property = value;} } } /// The channel name + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Constant] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Name = value ; } + public string Name { get => "SmsChannel"; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Name = "SmsChannel"; } /// The Sms phone [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string Phone { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelPropertiesInternal)Property).Phone; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelPropertiesInternal)Property).Phone = value ?? null; } + public string Phone { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelPropertiesInternal)Property).Phone; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelPropertiesInternal)Property).Phone = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelProperties _property; /// The set of properties specific to Sms channel resource [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SmsChannelProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.SmsChannelProperties()); set => this._property = value; } /// Provisioning state of the resource [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).ProvisioningState; } + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).ProvisioningState; } /// Creates an new instance. public SmsChannel() { - + this.__channel.Name = "SmsChannel"; } /// Validates that this object meets the validation criteria. @@ -93,7 +93,7 @@ public SmsChannel() /// Sms channel definition public partial interface ISmsChannel : Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannel + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannel { /// /// The Sms account SID. Value only returned through POST to the action Channel List API, otherwise empty. @@ -101,6 +101,9 @@ public partial interface ISmsChannel : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The Sms account SID. Value only returned through POST to the action Channel List API, otherwise empty.", SerializedName = @"accountSID", PossibleTypes = new [] { typeof(string) })] @@ -111,6 +114,9 @@ public partial interface ISmsChannel : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The Sms auth token. Value only returned through POST to the action Channel List API, otherwise empty.", SerializedName = @"authToken", PossibleTypes = new [] { typeof(string) })] @@ -119,6 +125,9 @@ public partial interface ISmsChannel : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Whether this channel is enabled for the bot", SerializedName = @"isEnabled", PossibleTypes = new [] { typeof(bool) })] @@ -127,6 +136,9 @@ public partial interface ISmsChannel : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Whether this channel is validated for the bot", SerializedName = @"isValidated", PossibleTypes = new [] { typeof(bool) })] @@ -135,6 +147,9 @@ public partial interface ISmsChannel : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The Sms phone", SerializedName = @"phone", PossibleTypes = new [] { typeof(string) })] @@ -143,7 +158,7 @@ public partial interface ISmsChannel : } /// Sms channel definition internal partial interface ISmsChannelInternal : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal { /// /// The Sms account SID. Value only returned through POST to the action Channel List API, otherwise empty. @@ -160,7 +175,7 @@ internal partial interface ISmsChannelInternal : /// The Sms phone string Phone { get; set; } /// The set of properties specific to Sms channel resource - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelProperties Property { get; set; } } } \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SmsChannel.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/SmsChannel.json.cs similarity index 93% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SmsChannel.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/SmsChannel.json.cs index 995e5fcbc386..857f689010a2 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SmsChannel.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/SmsChannel.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class SmsChannel partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannel. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannel. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannel. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannel. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannel FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannel FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new SmsChannel(json) : null; } @@ -77,8 +77,8 @@ internal SmsChannel(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.J { return; } - __channel = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Channel(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SmsChannelProperties.FromJson(__jsonProperties) : Property;} + __channel = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Channel(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.SmsChannelProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SmsChannelProperties.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/SmsChannelProperties.PowerShell.cs similarity index 66% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SmsChannelProperties.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/SmsChannelProperties.PowerShell.cs index d836ea2d187c..fbb613599f7d 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SmsChannelProperties.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/SmsChannelProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class SmsChannelProperties 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.BotService.Models.Api20220615Preview.ISmsChannelProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new SmsChannelProperties(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.BotService.Models.Api20220615Preview.ISmsChannelProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new SmsChannelProperties(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Pr /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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,29 +111,29 @@ internal SmsChannelProperties(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Phone")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelPropertiesInternal)this).Phone = (string) content.GetValueForProperty("Phone",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelPropertiesInternal)this).Phone, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelPropertiesInternal)this).Phone = (string) content.GetValueForProperty("Phone",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelPropertiesInternal)this).Phone, global::System.Convert.ToString); } if (content.Contains("AccountSid")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelPropertiesInternal)this).AccountSid = (string) content.GetValueForProperty("AccountSid",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelPropertiesInternal)this).AccountSid, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelPropertiesInternal)this).AccountSid = (string) content.GetValueForProperty("AccountSid",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelPropertiesInternal)this).AccountSid, global::System.Convert.ToString); } if (content.Contains("AuthToken")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelPropertiesInternal)this).AuthToken = (string) content.GetValueForProperty("AuthToken",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelPropertiesInternal)this).AuthToken, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelPropertiesInternal)this).AuthToken = (string) content.GetValueForProperty("AuthToken",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelPropertiesInternal)this).AuthToken, global::System.Convert.ToString); } if (content.Contains("IsValidated")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelPropertiesInternal)this).IsValidated = (bool?) content.GetValueForProperty("IsValidated",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelPropertiesInternal)this).IsValidated, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelPropertiesInternal)this).IsValidated = (bool?) content.GetValueForProperty("IsValidated",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelPropertiesInternal)this).IsValidated, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelPropertiesInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelPropertiesInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelPropertiesInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelPropertiesInternal)this).IsEnabled, (__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. @@ -142,23 +148,23 @@ internal SmsChannelProperties(global::System.Management.Automation.PSObject cont // actually deserialize if (content.Contains("Phone")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelPropertiesInternal)this).Phone = (string) content.GetValueForProperty("Phone",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelPropertiesInternal)this).Phone, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelPropertiesInternal)this).Phone = (string) content.GetValueForProperty("Phone",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelPropertiesInternal)this).Phone, global::System.Convert.ToString); } if (content.Contains("AccountSid")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelPropertiesInternal)this).AccountSid = (string) content.GetValueForProperty("AccountSid",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelPropertiesInternal)this).AccountSid, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelPropertiesInternal)this).AccountSid = (string) content.GetValueForProperty("AccountSid",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelPropertiesInternal)this).AccountSid, global::System.Convert.ToString); } if (content.Contains("AuthToken")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelPropertiesInternal)this).AuthToken = (string) content.GetValueForProperty("AuthToken",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelPropertiesInternal)this).AuthToken, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelPropertiesInternal)this).AuthToken = (string) content.GetValueForProperty("AuthToken",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelPropertiesInternal)this).AuthToken, global::System.Convert.ToString); } if (content.Contains("IsValidated")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelPropertiesInternal)this).IsValidated = (bool?) content.GetValueForProperty("IsValidated",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelPropertiesInternal)this).IsValidated, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelPropertiesInternal)this).IsValidated = (bool?) content.GetValueForProperty("IsValidated",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelPropertiesInternal)this).IsValidated, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelPropertiesInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelPropertiesInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelPropertiesInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelPropertiesInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializePSObject(content); } @@ -167,6 +173,18 @@ internal SmsChannelProperties(global::System.Management.Automation.PSObject cont /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.BotService.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 parameters to provide for the Sms channel. [System.ComponentModel.TypeConverter(typeof(SmsChannelPropertiesTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SmsChannelProperties.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/SmsChannelProperties.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SmsChannelProperties.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/SmsChannelProperties.TypeConverter.cs index cbcec5b7b765..bdbf705f1a54 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SmsChannelProperties.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/SmsChannelProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.ISmsChannelProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SmsChannelProperties.cs b/generated/BotService/BotService.Autorest/generated/api/Models/SmsChannelProperties.cs similarity index 91% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SmsChannelProperties.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/SmsChannelProperties.cs index 2cc68a66b1d8..1c700b8f2938 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SmsChannelProperties.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/SmsChannelProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// The parameters to provide for the Sms channel. public partial class SmsChannelProperties : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelProperties, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelProperties, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelPropertiesInternal { /// Backing field for property. @@ -68,6 +68,9 @@ public partial interface ISmsChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The Sms account SID. Value only returned through POST to the action Channel List API, otherwise empty.", SerializedName = @"accountSID", PossibleTypes = new [] { typeof(string) })] @@ -78,6 +81,9 @@ public partial interface ISmsChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The Sms auth token. Value only returned through POST to the action Channel List API, otherwise empty.", SerializedName = @"authToken", PossibleTypes = new [] { typeof(string) })] @@ -86,6 +92,9 @@ public partial interface ISmsChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Whether this channel is enabled for the bot", SerializedName = @"isEnabled", PossibleTypes = new [] { typeof(bool) })] @@ -94,6 +103,9 @@ public partial interface ISmsChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Whether this channel is validated for the bot", SerializedName = @"isValidated", PossibleTypes = new [] { typeof(bool) })] @@ -102,6 +114,9 @@ public partial interface ISmsChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The Sms phone", SerializedName = @"phone", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SmsChannelProperties.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/SmsChannelProperties.json.cs similarity index 93% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SmsChannelProperties.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/SmsChannelProperties.json.cs index e92740b1d55a..50d00c3baa06 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/SmsChannelProperties.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/SmsChannelProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class SmsChannelProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISmsChannelProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISmsChannelProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new SmsChannelProperties(json) : null; } @@ -77,11 +77,11 @@ internal SmsChannelProperties(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runt { return; } - {_phone = If( json?.PropertyT("phone"), out var __jsonPhone) ? (string)__jsonPhone : (string)Phone;} - {_accountSid = If( json?.PropertyT("accountSID"), out var __jsonAccountSid) ? (string)__jsonAccountSid : (string)AccountSid;} - {_authToken = If( json?.PropertyT("authToken"), out var __jsonAuthToken) ? (string)__jsonAuthToken : (string)AuthToken;} - {_isValidated = If( json?.PropertyT("isValidated"), out var __jsonIsValidated) ? (bool?)__jsonIsValidated : IsValidated;} - {_isEnabled = If( json?.PropertyT("isEnabled"), out var __jsonIsEnabled) ? (bool)__jsonIsEnabled : IsEnabled;} + {_phone = If( json?.PropertyT("phone"), out var __jsonPhone) ? (string)__jsonPhone : (string)_phone;} + {_accountSid = If( json?.PropertyT("accountSID"), out var __jsonAccountSid) ? (string)__jsonAccountSid : (string)_accountSid;} + {_authToken = If( json?.PropertyT("authToken"), out var __jsonAuthToken) ? (string)__jsonAuthToken : (string)_authToken;} + {_isValidated = If( json?.PropertyT("isValidated"), out var __jsonIsValidated) ? (bool?)__jsonIsValidated : _isValidated;} + {_isEnabled = If( json?.PropertyT("isEnabled"), out var __jsonIsEnabled) ? (bool)__jsonIsEnabled : _isEnabled;} AfterFromJson(json); } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/TelegramChannel.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/TelegramChannel.PowerShell.cs similarity index 61% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/TelegramChannel.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/TelegramChannel.PowerShell.cs index e33abf16274c..58d2545d132e 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/TelegramChannel.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/TelegramChannel.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class TelegramChannel 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.BotService.Models.Api20220615Preview.ITelegramChannel DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ITelegramChannel DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new TelegramChannel(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.BotService.Models.Api20220615Preview.ITelegramChannel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ITelegramChannel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new TelegramChannel(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Pr /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ITelegramChannel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ITelegramChannel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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. @@ -103,41 +111,41 @@ internal TelegramChannel(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ITelegramChannelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ITelegramChannelProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ITelegramChannelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.TelegramChannelPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ITelegramChannelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ITelegramChannelProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ITelegramChannelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.TelegramChannelPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Etag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Etag, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Etag, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).ProvisioningState, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("AccessToken")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ITelegramChannelInternal)this).AccessToken = (string) content.GetValueForProperty("AccessToken",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ITelegramChannelInternal)this).AccessToken, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ITelegramChannelInternal)this).AccessToken = (string) content.GetValueForProperty("AccessToken",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ITelegramChannelInternal)this).AccessToken, global::System.Convert.ToString); } if (content.Contains("IsValidated")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ITelegramChannelInternal)this).IsValidated = (bool?) content.GetValueForProperty("IsValidated",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ITelegramChannelInternal)this).IsValidated, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ITelegramChannelInternal)this).IsValidated = (bool?) content.GetValueForProperty("IsValidated",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ITelegramChannelInternal)this).IsValidated, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ITelegramChannelInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ITelegramChannelInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ITelegramChannelInternal)this).IsEnabled = (bool?) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ITelegramChannelInternal)this).IsEnabled, (__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. @@ -152,35 +160,35 @@ internal TelegramChannel(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ITelegramChannelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ITelegramChannelProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ITelegramChannelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.TelegramChannelPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ITelegramChannelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ITelegramChannelProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ITelegramChannelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.TelegramChannelPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Etag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Etag, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Etag, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).ProvisioningState, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("AccessToken")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ITelegramChannelInternal)this).AccessToken = (string) content.GetValueForProperty("AccessToken",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ITelegramChannelInternal)this).AccessToken, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ITelegramChannelInternal)this).AccessToken = (string) content.GetValueForProperty("AccessToken",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ITelegramChannelInternal)this).AccessToken, global::System.Convert.ToString); } if (content.Contains("IsValidated")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ITelegramChannelInternal)this).IsValidated = (bool?) content.GetValueForProperty("IsValidated",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ITelegramChannelInternal)this).IsValidated, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ITelegramChannelInternal)this).IsValidated = (bool?) content.GetValueForProperty("IsValidated",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ITelegramChannelInternal)this).IsValidated, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ITelegramChannelInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ITelegramChannelInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ITelegramChannelInternal)this).IsEnabled = (bool?) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ITelegramChannelInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializePSObject(content); } @@ -189,6 +197,18 @@ internal TelegramChannel(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.BotService.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(); + } } /// Telegram channel definition [System.ComponentModel.TypeConverter(typeof(TelegramChannelTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/TelegramChannel.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/TelegramChannel.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/TelegramChannel.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/TelegramChannel.TypeConverter.cs index b98d08d4c41b..f7f994f810f4 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/TelegramChannel.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/TelegramChannel.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.ITelegramChannel ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ITelegramChannel ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ITelegramChannel).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ITelegramChannel).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/TelegramChannel.cs b/generated/BotService/BotService.Autorest/generated/api/Models/TelegramChannel.cs similarity index 64% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/TelegramChannel.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/TelegramChannel.cs index e476e18dbc93..dfef581d092c 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/TelegramChannel.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/TelegramChannel.cs @@ -3,69 +3,69 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// Telegram channel definition public partial class TelegramChannel : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ITelegramChannel, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ITelegramChannelInternal, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ITelegramChannel, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ITelegramChannelInternal, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannel __channel = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Channel(); + private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannel __channel = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Channel(); /// /// The Telegram access token. Value only returned through POST to the action Channel List API, otherwise empty. /// [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string AccessToken { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ITelegramChannelPropertiesInternal)Property).AccessToken; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ITelegramChannelPropertiesInternal)Property).AccessToken = value ?? null; } + public string AccessToken { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ITelegramChannelPropertiesInternal)Property).AccessToken; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ITelegramChannelPropertiesInternal)Property).AccessToken = value ?? null; } /// Entity Tag of the resource [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Etag = value ?? null; } + public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Etag = value ?? null; } /// Whether this channel is enabled for the bot [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public bool? IsEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ITelegramChannelPropertiesInternal)Property).IsEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ITelegramChannelPropertiesInternal)Property).IsEnabled = value ?? default(bool); } + public bool? IsEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ITelegramChannelPropertiesInternal)Property).IsEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ITelegramChannelPropertiesInternal)Property).IsEnabled = value ?? default(bool); } /// Whether this channel is validated for the bot [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public bool? IsValidated { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ITelegramChannelPropertiesInternal)Property).IsValidated; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ITelegramChannelPropertiesInternal)Property).IsValidated = value ?? default(bool); } + public bool? IsValidated { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ITelegramChannelPropertiesInternal)Property).IsValidated; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ITelegramChannelPropertiesInternal)Property).IsValidated = value ?? default(bool); } /// Specifies the location of the resource. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Location = value ?? null; } + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Location = value ?? null; } /// Internal Acessors for ProvisioningState - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).ProvisioningState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).ProvisioningState = value; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ITelegramChannelProperties Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ITelegramChannelInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.TelegramChannelProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ITelegramChannelProperties Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ITelegramChannelInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.TelegramChannelProperties()); set { {_property = value;} } } /// The channel name + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Constant] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Name = value ; } + public string Name { get => "TelegramChannel"; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Name = "TelegramChannel"; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ITelegramChannelProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ITelegramChannelProperties _property; /// The set of properties specific to Telegram channel resource [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ITelegramChannelProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.TelegramChannelProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ITelegramChannelProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.TelegramChannelProperties()); set => this._property = value; } /// Provisioning state of the resource [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).ProvisioningState; } + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).ProvisioningState; } /// Creates an new instance. public TelegramChannel() { - + this.__channel.Name = "TelegramChannel"; } /// Validates that this object meets the validation criteria. @@ -83,7 +83,7 @@ public TelegramChannel() /// Telegram channel definition public partial interface ITelegramChannel : Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannel + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannel { /// /// The Telegram access token. Value only returned through POST to the action Channel List API, otherwise empty. @@ -91,6 +91,9 @@ public partial interface ITelegramChannel : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The Telegram access token. Value only returned through POST to the action Channel List API, otherwise empty.", SerializedName = @"accessToken", PossibleTypes = new [] { typeof(string) })] @@ -99,6 +102,9 @@ public partial interface ITelegramChannel : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Whether this channel is enabled for the bot", SerializedName = @"isEnabled", PossibleTypes = new [] { typeof(bool) })] @@ -107,6 +113,9 @@ public partial interface ITelegramChannel : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Whether this channel is validated for the bot", SerializedName = @"isValidated", PossibleTypes = new [] { typeof(bool) })] @@ -115,7 +124,7 @@ public partial interface ITelegramChannel : } /// Telegram channel definition internal partial interface ITelegramChannelInternal : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal { /// /// The Telegram access token. Value only returned through POST to the action Channel List API, otherwise empty. @@ -126,7 +135,7 @@ internal partial interface ITelegramChannelInternal : /// Whether this channel is validated for the bot bool? IsValidated { get; set; } /// The set of properties specific to Telegram channel resource - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ITelegramChannelProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ITelegramChannelProperties Property { get; set; } } } \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/TelegramChannel.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/TelegramChannel.json.cs similarity index 92% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/TelegramChannel.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/TelegramChannel.json.cs index d3071b03214f..219030bdd390 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/TelegramChannel.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/TelegramChannel.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class TelegramChannel partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ITelegramChannel. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ITelegramChannel. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ITelegramChannel. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ITelegramChannel. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ITelegramChannel FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ITelegramChannel FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new TelegramChannel(json) : null; } @@ -77,8 +77,8 @@ internal TelegramChannel(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.J { return; } - __channel = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Channel(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.TelegramChannelProperties.FromJson(__jsonProperties) : Property;} + __channel = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Channel(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.TelegramChannelProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/TelegramChannelProperties.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/TelegramChannelProperties.PowerShell.cs similarity index 69% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/TelegramChannelProperties.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/TelegramChannelProperties.PowerShell.cs index 283cc6129b59..c2a127a6bbec 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/TelegramChannelProperties.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/TelegramChannelProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class TelegramChannelProperties 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.BotService.Models.Api20220615Preview.ITelegramChannelProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ITelegramChannelProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new TelegramChannelProperties(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.BotService.Models.Api20220615Preview.ITelegramChannelProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ITelegramChannelProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new TelegramChannelProperties(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Pr /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ITelegramChannelProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ITelegramChannelProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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 TelegramChannelProperties(global::System.Collections.IDictionary conten // actually deserialize if (content.Contains("AccessToken")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ITelegramChannelPropertiesInternal)this).AccessToken = (string) content.GetValueForProperty("AccessToken",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ITelegramChannelPropertiesInternal)this).AccessToken, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ITelegramChannelPropertiesInternal)this).AccessToken = (string) content.GetValueForProperty("AccessToken",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ITelegramChannelPropertiesInternal)this).AccessToken, global::System.Convert.ToString); } if (content.Contains("IsValidated")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ITelegramChannelPropertiesInternal)this).IsValidated = (bool?) content.GetValueForProperty("IsValidated",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ITelegramChannelPropertiesInternal)this).IsValidated, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ITelegramChannelPropertiesInternal)this).IsValidated = (bool?) content.GetValueForProperty("IsValidated",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ITelegramChannelPropertiesInternal)this).IsValidated, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ITelegramChannelPropertiesInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ITelegramChannelPropertiesInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ITelegramChannelPropertiesInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ITelegramChannelPropertiesInternal)this).IsEnabled, (__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. @@ -134,15 +140,15 @@ internal TelegramChannelProperties(global::System.Management.Automation.PSObject // actually deserialize if (content.Contains("AccessToken")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ITelegramChannelPropertiesInternal)this).AccessToken = (string) content.GetValueForProperty("AccessToken",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ITelegramChannelPropertiesInternal)this).AccessToken, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ITelegramChannelPropertiesInternal)this).AccessToken = (string) content.GetValueForProperty("AccessToken",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ITelegramChannelPropertiesInternal)this).AccessToken, global::System.Convert.ToString); } if (content.Contains("IsValidated")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ITelegramChannelPropertiesInternal)this).IsValidated = (bool?) content.GetValueForProperty("IsValidated",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ITelegramChannelPropertiesInternal)this).IsValidated, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ITelegramChannelPropertiesInternal)this).IsValidated = (bool?) content.GetValueForProperty("IsValidated",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ITelegramChannelPropertiesInternal)this).IsValidated, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ITelegramChannelPropertiesInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ITelegramChannelPropertiesInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ITelegramChannelPropertiesInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ITelegramChannelPropertiesInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializePSObject(content); } @@ -151,6 +157,18 @@ internal TelegramChannelProperties(global::System.Management.Automation.PSObject /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.BotService.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 parameters to provide for the Telegram channel. [System.ComponentModel.TypeConverter(typeof(TelegramChannelPropertiesTypeConverter))] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/TelegramChannelProperties.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/TelegramChannelProperties.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/TelegramChannelProperties.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/TelegramChannelProperties.TypeConverter.cs index 503c59a6bcff..933966f5d390 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/TelegramChannelProperties.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/TelegramChannelProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.ITelegramChannelProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ITelegramChannelProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ITelegramChannelProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ITelegramChannelProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/TelegramChannelProperties.cs b/generated/BotService/BotService.Autorest/generated/api/Models/TelegramChannelProperties.cs similarity index 90% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/TelegramChannelProperties.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/TelegramChannelProperties.cs index 560b1234e266..6aceb0e7aa0c 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/TelegramChannelProperties.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/TelegramChannelProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// The parameters to provide for the Telegram channel. public partial class TelegramChannelProperties : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ITelegramChannelProperties, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ITelegramChannelPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ITelegramChannelProperties, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ITelegramChannelPropertiesInternal { /// Backing field for property. @@ -52,6 +52,9 @@ public partial interface ITelegramChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The Telegram access token. Value only returned through POST to the action Channel List API, otherwise empty.", SerializedName = @"accessToken", PossibleTypes = new [] { typeof(string) })] @@ -60,6 +63,9 @@ public partial interface ITelegramChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Whether this channel is enabled for the bot", SerializedName = @"isEnabled", PossibleTypes = new [] { typeof(bool) })] @@ -68,6 +74,9 @@ public partial interface ITelegramChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Whether this channel is validated for the bot", SerializedName = @"isValidated", PossibleTypes = new [] { typeof(bool) })] diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/TelegramChannelProperties.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/TelegramChannelProperties.json.cs similarity index 93% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/TelegramChannelProperties.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/TelegramChannelProperties.json.cs index 91bb20c87437..0ec07ee2e79d 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/TelegramChannelProperties.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/TelegramChannelProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class TelegramChannelProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ITelegramChannelProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ITelegramChannelProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ITelegramChannelProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ITelegramChannelProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ITelegramChannelProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ITelegramChannelProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new TelegramChannelProperties(json) : null; } @@ -77,9 +77,9 @@ internal TelegramChannelProperties(Microsoft.Azure.PowerShell.Cmdlets.BotService { return; } - {_accessToken = If( json?.PropertyT("accessToken"), out var __jsonAccessToken) ? (string)__jsonAccessToken : (string)AccessToken;} - {_isValidated = If( json?.PropertyT("isValidated"), out var __jsonIsValidated) ? (bool?)__jsonIsValidated : IsValidated;} - {_isEnabled = If( json?.PropertyT("isEnabled"), out var __jsonIsEnabled) ? (bool)__jsonIsEnabled : IsEnabled;} + {_accessToken = If( json?.PropertyT("accessToken"), out var __jsonAccessToken) ? (string)__jsonAccessToken : (string)_accessToken;} + {_isValidated = If( json?.PropertyT("isValidated"), out var __jsonIsValidated) ? (bool?)__jsonIsValidated : _isValidated;} + {_isEnabled = If( json?.PropertyT("isEnabled"), out var __jsonIsEnabled) ? (bool)__jsonIsEnabled : _isEnabled;} AfterFromJson(json); } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/WebChatChannel.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/WebChatChannel.PowerShell.cs similarity index 61% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/WebChatChannel.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/WebChatChannel.PowerShell.cs index e99b0088fc04..408a237d8f7c 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/WebChatChannel.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/WebChatChannel.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class WebChatChannel 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.BotService.Models.Api20220615Preview.IWebChatChannel DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatChannel DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WebChatChannel(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.BotService.Models.Api20220615Preview.IWebChatChannel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatChannel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WebChatChannel(content); } @@ -85,15 +93,27 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Pr /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IWebChatChannel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatChannel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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. @@ -108,37 +128,37 @@ internal WebChatChannel(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IWebChatChannelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IWebChatChannelProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IWebChatChannelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.WebChatChannelPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatChannelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatChannelProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatChannelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.WebChatChannelPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Etag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Etag, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Etag, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).ProvisioningState, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("WebChatEmbedCode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IWebChatChannelInternal)this).WebChatEmbedCode = (string) content.GetValueForProperty("WebChatEmbedCode",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IWebChatChannelInternal)this).WebChatEmbedCode, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatChannelInternal)this).WebChatEmbedCode = (string) content.GetValueForProperty("WebChatEmbedCode",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatChannelInternal)this).WebChatEmbedCode, global::System.Convert.ToString); } if (content.Contains("Site")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IWebChatChannelInternal)this).Site = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISite[]) content.GetValueForProperty("Site",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IWebChatChannelInternal)this).Site, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SiteTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatChannelInternal)this).Site = (System.Collections.Generic.List) content.GetValueForProperty("Site",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatChannelInternal)this).Site, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.WebChatSiteTypeConverter.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. @@ -153,31 +173,31 @@ internal WebChatChannel(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IWebChatChannelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IWebChatChannelProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IWebChatChannelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.WebChatChannelPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatChannelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatChannelProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatChannelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.WebChatChannelPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Etag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Etag, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Etag, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).ProvisioningState, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("WebChatEmbedCode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IWebChatChannelInternal)this).WebChatEmbedCode = (string) content.GetValueForProperty("WebChatEmbedCode",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IWebChatChannelInternal)this).WebChatEmbedCode, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatChannelInternal)this).WebChatEmbedCode = (string) content.GetValueForProperty("WebChatEmbedCode",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatChannelInternal)this).WebChatEmbedCode, global::System.Convert.ToString); } if (content.Contains("Site")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IWebChatChannelInternal)this).Site = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISite[]) content.GetValueForProperty("Site",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IWebChatChannelInternal)this).Site, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SiteTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatChannelInternal)this).Site = (System.Collections.Generic.List) content.GetValueForProperty("Site",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatChannelInternal)this).Site, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.WebChatSiteTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/WebChatChannel.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/WebChatChannel.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/WebChatChannel.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/WebChatChannel.TypeConverter.cs index fa9b871d29b4..bd9e86f67422 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/WebChatChannel.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/WebChatChannel.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IWebChatChannel ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatChannel ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IWebChatChannel).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatChannel).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/WebChatChannel.cs b/generated/BotService/BotService.Autorest/generated/api/Models/WebChatChannel.cs similarity index 57% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/WebChatChannel.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/WebChatChannel.cs index d2e84e6e284b..7c848825f962 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/WebChatChannel.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/WebChatChannel.cs @@ -3,61 +3,61 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// Web Chat channel definition public partial class WebChatChannel : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IWebChatChannel, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IWebChatChannelInternal, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatChannel, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatChannelInternal, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannel __channel = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Channel(); + private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannel __channel = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Channel(); /// Entity Tag of the resource [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Etag = value ?? null; } + public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Etag = value ?? null; } /// Specifies the location of the resource. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Location = value ?? null; } + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Location = value ?? null; } /// Internal Acessors for ProvisioningState - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).ProvisioningState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).ProvisioningState = value; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IWebChatChannelProperties Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IWebChatChannelInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.WebChatChannelProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatChannelProperties Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatChannelInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.WebChatChannelProperties()); set { {_property = value;} } } /// Internal Acessors for WebChatEmbedCode - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IWebChatChannelInternal.WebChatEmbedCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IWebChatChannelPropertiesInternal)Property).WebChatEmbedCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IWebChatChannelPropertiesInternal)Property).WebChatEmbedCode = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatChannelInternal.WebChatEmbedCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatChannelPropertiesInternal)Property).WebChatEmbedCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatChannelPropertiesInternal)Property).WebChatEmbedCode = value; } /// The channel name + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Constant] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).Name = value ; } + public string Name { get => "WebChatChannel"; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).Name = "WebChatChannel"; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IWebChatChannelProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatChannelProperties _property; /// The set of properties specific to Web Chat channel resource [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IWebChatChannelProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.WebChatChannelProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatChannelProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.WebChatChannelProperties()); set => this._property = value; } /// Provisioning state of the resource [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal)__channel).ProvisioningState; } + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal)__channel).ProvisioningState; } /// The list of Web Chat sites [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISite[] Site { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IWebChatChannelPropertiesInternal)Property).Site; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IWebChatChannelPropertiesInternal)Property).Site = value ?? null /* arrayOf */; } + public System.Collections.Generic.List Site { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatChannelPropertiesInternal)Property).Site; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatChannelPropertiesInternal)Property).Site = value ?? null /* arrayOf */; } /// Web chat control embed code [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inlined)] - public string WebChatEmbedCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IWebChatChannelPropertiesInternal)Property).WebChatEmbedCode; } + public string WebChatEmbedCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatChannelPropertiesInternal)Property).WebChatEmbedCode; } /// Validates that this object meets the validation criteria. /// an instance that will receive validation @@ -74,26 +74,32 @@ public partial class WebChatChannel : /// Creates an new instance. public WebChatChannel() { - + this.__channel.Name = "WebChatChannel"; } } /// Web Chat channel definition public partial interface IWebChatChannel : Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannel + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannel { /// The list of Web Chat sites [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of Web Chat sites", SerializedName = @"sites", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISite) })] - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISite[] Site { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatSite) })] + System.Collections.Generic.List Site { get; set; } /// Web chat control embed code [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Web chat control embed code", SerializedName = @"webChatEmbedCode", PossibleTypes = new [] { typeof(string) })] @@ -102,12 +108,12 @@ public partial interface IWebChatChannel : } /// Web Chat channel definition internal partial interface IWebChatChannelInternal : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IChannelInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IChannelInternal { /// The set of properties specific to Web Chat channel resource - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IWebChatChannelProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatChannelProperties Property { get; set; } /// The list of Web Chat sites - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISite[] Site { get; set; } + System.Collections.Generic.List Site { get; set; } /// Web chat control embed code string WebChatEmbedCode { get; set; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/WebChatChannel.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/WebChatChannel.json.cs similarity index 92% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/WebChatChannel.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/WebChatChannel.json.cs index 4e13abba9ccd..3a84a925ffb1 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/WebChatChannel.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/WebChatChannel.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WebChatChannel partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IWebChatChannel. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatChannel. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IWebChatChannel. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatChannel. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IWebChatChannel FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatChannel FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new WebChatChannel(json) : null; } @@ -102,8 +102,8 @@ internal WebChatChannel(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Js { return; } - __channel = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Channel(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.WebChatChannelProperties.FromJson(__jsonProperties) : Property;} + __channel = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Channel(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.WebChatChannelProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/WebChatChannelProperties.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/WebChatChannelProperties.PowerShell.cs similarity index 69% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/WebChatChannelProperties.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/WebChatChannelProperties.PowerShell.cs index 1563911528d5..b76ba9e53363 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/WebChatChannelProperties.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/WebChatChannelProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class WebChatChannelProperties 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.BotService.Models.Api20220615Preview.IWebChatChannelProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatChannelProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WebChatChannelProperties(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.BotService.Models.Api20220615Preview.IWebChatChannelProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatChannelProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WebChatChannelProperties(content); } @@ -87,15 +93,27 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Pr /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IWebChatChannelProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatChannelProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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,17 +128,17 @@ internal WebChatChannelProperties(global::System.Collections.IDictionary content // actually deserialize if (content.Contains("WebChatEmbedCode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IWebChatChannelPropertiesInternal)this).WebChatEmbedCode = (string) content.GetValueForProperty("WebChatEmbedCode",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IWebChatChannelPropertiesInternal)this).WebChatEmbedCode, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatChannelPropertiesInternal)this).WebChatEmbedCode = (string) content.GetValueForProperty("WebChatEmbedCode",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatChannelPropertiesInternal)this).WebChatEmbedCode, global::System.Convert.ToString); } if (content.Contains("Site")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IWebChatChannelPropertiesInternal)this).Site = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISite[]) content.GetValueForProperty("Site",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IWebChatChannelPropertiesInternal)this).Site, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SiteTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatChannelPropertiesInternal)this).Site = (System.Collections.Generic.List) content.GetValueForProperty("Site",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatChannelPropertiesInternal)this).Site, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.WebChatSiteTypeConverter.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. @@ -135,11 +153,11 @@ internal WebChatChannelProperties(global::System.Management.Automation.PSObject // actually deserialize if (content.Contains("WebChatEmbedCode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IWebChatChannelPropertiesInternal)this).WebChatEmbedCode = (string) content.GetValueForProperty("WebChatEmbedCode",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IWebChatChannelPropertiesInternal)this).WebChatEmbedCode, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatChannelPropertiesInternal)this).WebChatEmbedCode = (string) content.GetValueForProperty("WebChatEmbedCode",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatChannelPropertiesInternal)this).WebChatEmbedCode, global::System.Convert.ToString); } if (content.Contains("Site")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IWebChatChannelPropertiesInternal)this).Site = (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISite[]) content.GetValueForProperty("Site",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IWebChatChannelPropertiesInternal)this).Site, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SiteTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatChannelPropertiesInternal)this).Site = (System.Collections.Generic.List) content.GetValueForProperty("Site",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatChannelPropertiesInternal)this).Site, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.WebChatSiteTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/WebChatChannelProperties.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/WebChatChannelProperties.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/WebChatChannelProperties.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/WebChatChannelProperties.TypeConverter.cs index 2d88ed66f801..51c0401676eb 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/WebChatChannelProperties.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/WebChatChannelProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IWebChatChannelProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatChannelProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IWebChatChannelProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatChannelProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/WebChatChannelProperties.cs b/generated/BotService/BotService.Autorest/generated/api/Models/WebChatChannelProperties.cs similarity index 71% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/WebChatChannelProperties.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/WebChatChannelProperties.cs index e104159758af..c709fe5a85fb 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/WebChatChannelProperties.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/WebChatChannelProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// The parameters to provide for the Web Chat channel. public partial class WebChatChannelProperties : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IWebChatChannelProperties, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IWebChatChannelPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatChannelProperties, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatChannelPropertiesInternal { /// Internal Acessors for WebChatEmbedCode - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IWebChatChannelPropertiesInternal.WebChatEmbedCode { get => this._webChatEmbedCode; set { {_webChatEmbedCode = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatChannelPropertiesInternal.WebChatEmbedCode { get => this._webChatEmbedCode; set { {_webChatEmbedCode = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISite[] _site; + private System.Collections.Generic.List _site; /// The list of Web Chat sites [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISite[] Site { get => this._site; set => this._site = value; } + public System.Collections.Generic.List Site { get => this._site; set => this._site = value; } /// Backing field for property. private string _webChatEmbedCode; @@ -44,14 +44,20 @@ public partial interface IWebChatChannelProperties : [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of Web Chat sites", SerializedName = @"sites", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISite) })] - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISite[] Site { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatSite) })] + System.Collections.Generic.List Site { get; set; } /// Web chat control embed code [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Web chat control embed code", SerializedName = @"webChatEmbedCode", PossibleTypes = new [] { typeof(string) })] @@ -63,7 +69,7 @@ internal partial interface IWebChatChannelPropertiesInternal { /// The list of Web Chat sites - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISite[] Site { get; set; } + System.Collections.Generic.List Site { get; set; } /// Web chat control embed code string WebChatEmbedCode { get; set; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/WebChatChannelProperties.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/WebChatChannelProperties.json.cs similarity index 89% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/WebChatChannelProperties.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/WebChatChannelProperties.json.cs index 523498628572..8aee5e623bc2 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/WebChatChannelProperties.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/WebChatChannelProperties.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WebChatChannelProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IWebChatChannelProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatChannelProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IWebChatChannelProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatChannelProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IWebChatChannelProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatChannelProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new WebChatChannelProperties(json) : null; } @@ -84,7 +84,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode ToJso { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._webChatEmbedCode)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonString(this._webChatEmbedCode.ToString()) : null, "webChatEmbedCode" ,container.Add ); } @@ -113,8 +113,8 @@ internal WebChatChannelProperties(Microsoft.Azure.PowerShell.Cmdlets.BotService. { return; } - {_webChatEmbedCode = If( json?.PropertyT("webChatEmbedCode"), out var __jsonWebChatEmbedCode) ? (string)__jsonWebChatEmbedCode : (string)WebChatEmbedCode;} - {_site = If( json?.PropertyT("sites"), out var __jsonSites) ? If( __jsonSites as Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.ISite) (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Site.FromJson(__u) )) ))() : null : Site;} + {_webChatEmbedCode = If( json?.PropertyT("webChatEmbedCode"), out var __jsonWebChatEmbedCode) ? (string)__jsonWebChatEmbedCode : (string)_webChatEmbedCode;} + {_site = If( json?.PropertyT("sites"), out var __jsonSites) ? If( __jsonSites as Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.IWebChatSite) (Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.WebChatSite.FromJson(__u) )) ))() : null : _site;} AfterFromJson(json); } } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/WebChatSite.PowerShell.cs b/generated/BotService/BotService.Autorest/generated/api/Models/WebChatSite.PowerShell.cs similarity index 52% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/WebChatSite.PowerShell.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/WebChatSite.PowerShell.cs index 8c86b17103ce..d1dfd483229a 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/WebChatSite.PowerShell.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/WebChatSite.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class WebChatSite 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.BotService.Models.Api20220615Preview.IWebChatSite DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatSite DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WebChatSite(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.BotService.Models.Api20220615Preview.IWebChatSite DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatSite DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WebChatSite(content); } @@ -85,15 +93,27 @@ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Pr /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IWebChatSite FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatSite FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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. @@ -108,77 +128,77 @@ internal WebChatSite(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Key")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).Key, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).Key, global::System.Convert.ToString); } if (content.Contains("Key2")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).Key2 = (string) content.GetValueForProperty("Key2",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).Key2, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).Key2 = (string) content.GetValueForProperty("Key2",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).Key2, global::System.Convert.ToString); } if (content.Contains("IsEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsTokenEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsTokenEnabled = (bool?) content.GetValueForProperty("IsTokenEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsTokenEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsTokenEnabled = (bool?) content.GetValueForProperty("IsTokenEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsTokenEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsEndpointParametersEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsEndpointParametersEnabled = (bool?) content.GetValueForProperty("IsEndpointParametersEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsEndpointParametersEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsEndpointParametersEnabled = (bool?) content.GetValueForProperty("IsEndpointParametersEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsEndpointParametersEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsDetailedLoggingEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsDetailedLoggingEnabled = (bool?) content.GetValueForProperty("IsDetailedLoggingEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsDetailedLoggingEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsDetailedLoggingEnabled = (bool?) content.GetValueForProperty("IsDetailedLoggingEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsDetailedLoggingEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsBlockUserUploadEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsBlockUserUploadEnabled = (bool?) content.GetValueForProperty("IsBlockUserUploadEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsBlockUserUploadEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsBlockUserUploadEnabled = (bool?) content.GetValueForProperty("IsBlockUserUploadEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsBlockUserUploadEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsNoStorageEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsNoStorageEnabled = (bool?) content.GetValueForProperty("IsNoStorageEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsNoStorageEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsNoStorageEnabled = (bool?) content.GetValueForProperty("IsNoStorageEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsNoStorageEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("ETag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).ETag, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).ETag, global::System.Convert.ToString); } if (content.Contains("AppId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).AppId = (string) content.GetValueForProperty("AppId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).AppId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).AppId = (string) content.GetValueForProperty("AppId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).AppId, global::System.Convert.ToString); } if (content.Contains("IsV1Enabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsV1Enabled = (bool?) content.GetValueForProperty("IsV1Enabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsV1Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsV1Enabled = (bool?) content.GetValueForProperty("IsV1Enabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsV1Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsV3Enabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsV3Enabled = (bool?) content.GetValueForProperty("IsV3Enabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsV3Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsV3Enabled = (bool?) content.GetValueForProperty("IsV3Enabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsV3Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsSecureSiteEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsSecureSiteEnabled = (bool?) content.GetValueForProperty("IsSecureSiteEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsSecureSiteEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsSecureSiteEnabled = (bool?) content.GetValueForProperty("IsSecureSiteEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsSecureSiteEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("TrustedOrigin")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).TrustedOrigin = (string[]) content.GetValueForProperty("TrustedOrigin",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).TrustedOrigin, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).TrustedOrigin = (System.Collections.Generic.List) content.GetValueForProperty("TrustedOrigin",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).TrustedOrigin, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("IsWebchatPreviewEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsWebchatPreviewEnabled = (bool?) content.GetValueForProperty("IsWebchatPreviewEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsWebchatPreviewEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsWebchatPreviewEnabled = (bool?) content.GetValueForProperty("IsWebchatPreviewEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsWebchatPreviewEnabled, (__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. @@ -193,71 +213,71 @@ internal WebChatSite(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Key")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).Key, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).Key, global::System.Convert.ToString); } if (content.Contains("Key2")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).Key2 = (string) content.GetValueForProperty("Key2",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).Key2, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).Key2 = (string) content.GetValueForProperty("Key2",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).Key2, global::System.Convert.ToString); } if (content.Contains("IsEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsEnabled = (bool) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsTokenEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsTokenEnabled = (bool?) content.GetValueForProperty("IsTokenEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsTokenEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsTokenEnabled = (bool?) content.GetValueForProperty("IsTokenEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsTokenEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsEndpointParametersEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsEndpointParametersEnabled = (bool?) content.GetValueForProperty("IsEndpointParametersEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsEndpointParametersEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsEndpointParametersEnabled = (bool?) content.GetValueForProperty("IsEndpointParametersEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsEndpointParametersEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsDetailedLoggingEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsDetailedLoggingEnabled = (bool?) content.GetValueForProperty("IsDetailedLoggingEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsDetailedLoggingEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsDetailedLoggingEnabled = (bool?) content.GetValueForProperty("IsDetailedLoggingEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsDetailedLoggingEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsBlockUserUploadEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsBlockUserUploadEnabled = (bool?) content.GetValueForProperty("IsBlockUserUploadEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsBlockUserUploadEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsBlockUserUploadEnabled = (bool?) content.GetValueForProperty("IsBlockUserUploadEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsBlockUserUploadEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsNoStorageEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsNoStorageEnabled = (bool?) content.GetValueForProperty("IsNoStorageEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsNoStorageEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsNoStorageEnabled = (bool?) content.GetValueForProperty("IsNoStorageEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsNoStorageEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("ETag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).ETag, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).ETag, global::System.Convert.ToString); } if (content.Contains("AppId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).AppId = (string) content.GetValueForProperty("AppId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).AppId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).AppId = (string) content.GetValueForProperty("AppId",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).AppId, global::System.Convert.ToString); } if (content.Contains("IsV1Enabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsV1Enabled = (bool?) content.GetValueForProperty("IsV1Enabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsV1Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsV1Enabled = (bool?) content.GetValueForProperty("IsV1Enabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsV1Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsV3Enabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsV3Enabled = (bool?) content.GetValueForProperty("IsV3Enabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsV3Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsV3Enabled = (bool?) content.GetValueForProperty("IsV3Enabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsV3Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsSecureSiteEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsSecureSiteEnabled = (bool?) content.GetValueForProperty("IsSecureSiteEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsSecureSiteEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsSecureSiteEnabled = (bool?) content.GetValueForProperty("IsSecureSiteEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsSecureSiteEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("TrustedOrigin")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).TrustedOrigin = (string[]) content.GetValueForProperty("TrustedOrigin",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).TrustedOrigin, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).TrustedOrigin = (System.Collections.Generic.List) content.GetValueForProperty("TrustedOrigin",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).TrustedOrigin, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("IsWebchatPreviewEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsWebchatPreviewEnabled = (bool?) content.GetValueForProperty("IsWebchatPreviewEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)this).IsWebchatPreviewEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsWebchatPreviewEnabled = (bool?) content.GetValueForProperty("IsWebchatPreviewEnabled",((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)this).IsWebchatPreviewEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializePSObject(content); } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/WebChatSite.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Models/WebChatSite.TypeConverter.cs similarity index 96% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/WebChatSite.TypeConverter.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/WebChatSite.TypeConverter.cs index 88e4da43a0f3..2cd59d772cb7 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/WebChatSite.TypeConverter.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/WebChatSite.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IWebChatSite ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatSite ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IWebChatSite).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatSite).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/WebChatSite.cs b/generated/BotService/BotService.Autorest/generated/api/Models/WebChatSite.cs similarity index 58% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/WebChatSite.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/WebChatSite.cs index d133fc174601..aaa04e3f2c4a 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/WebChatSite.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/WebChatSite.cs @@ -3,107 +3,106 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; /// A site for the Webchat channel public partial class WebChatSite : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IWebChatSite, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IWebChatSiteInternal, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatSite, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatSiteInternal, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISite __site = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Site(); + private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISite __site = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Site(); /// DirectLine application id [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string AppId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).AppId; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).AppId = value ?? null; } + public string AppId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).AppId; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).AppId = value ?? null; } /// Entity Tag [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string ETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).ETag; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).ETag = value ?? null; } + public string ETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).ETag; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).ETag = value ?? null; } /// Site Id [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).Id; } /// Whether this site is enabled for block user upload. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public bool? IsBlockUserUploadEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).IsBlockUserUploadEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).IsBlockUserUploadEnabled = value ?? default(bool); } + public bool? IsBlockUserUploadEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).IsBlockUserUploadEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).IsBlockUserUploadEnabled = value ?? default(bool); } /// Whether this site is disabled detailed logging for [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public bool? IsDetailedLoggingEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).IsDetailedLoggingEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).IsDetailedLoggingEnabled = value ?? default(bool); } + public bool? IsDetailedLoggingEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).IsDetailedLoggingEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).IsDetailedLoggingEnabled = value ?? default(bool); } /// Whether this site is enabled for DirectLine channel [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public bool IsEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).IsEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).IsEnabled = value ; } + public bool IsEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).IsEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).IsEnabled = value ; } /// Whether this site is EndpointParameters enabled for channel [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public bool? IsEndpointParametersEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).IsEndpointParametersEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).IsEndpointParametersEnabled = value ?? default(bool); } + public bool? IsEndpointParametersEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).IsEndpointParametersEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).IsEndpointParametersEnabled = value ?? default(bool); } /// Whether this no-storage site is disabled detailed logging for [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public bool? IsNoStorageEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).IsNoStorageEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).IsNoStorageEnabled = value ?? default(bool); } + public bool? IsNoStorageEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).IsNoStorageEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).IsNoStorageEnabled = value ?? default(bool); } /// Whether this site is enabled for authentication with Bot Framework. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public bool? IsSecureSiteEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).IsSecureSiteEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).IsSecureSiteEnabled = value ?? default(bool); } + public bool? IsSecureSiteEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).IsSecureSiteEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).IsSecureSiteEnabled = value ?? default(bool); } /// Whether this site is token enabled for channel [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public bool? IsTokenEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).IsTokenEnabled; } + public bool? IsTokenEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).IsTokenEnabled; } /// Whether this site is enabled for Bot Framework V1 protocol. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public bool? IsV1Enabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).IsV1Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).IsV1Enabled = value ?? default(bool); } + public bool? IsV1Enabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).IsV1Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).IsV1Enabled = value ?? default(bool); } /// Whether this site is enabled for Bot Framework V1 protocol. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public bool? IsV3Enabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).IsV3Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).IsV3Enabled = value ?? default(bool); } + public bool? IsV3Enabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).IsV3Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).IsV3Enabled = value ?? default(bool); } /// Whether this site is enabled for preview versions of Webchat [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public bool? IsWebchatPreviewEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).IsWebchatPreviewEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).IsWebchatPreviewEnabled = value ?? default(bool); } + public bool? IsWebchatPreviewEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).IsWebchatPreviewEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).IsWebchatPreviewEnabled = value ?? default(bool); } /// /// Primary key. Value only returned through POST to the action Channel List API, otherwise empty. /// [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Key { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).Key; } + public string Key { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).Key; } /// /// Secondary key. Value only returned through POST to the action Channel List API, otherwise empty. /// [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Key2 { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).Key2; } + public string Key2 { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).Key2; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).Id = value; } /// Internal Acessors for IsTokenEnabled - bool? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal.IsTokenEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).IsTokenEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).IsTokenEnabled = value; } + bool? Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal.IsTokenEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).IsTokenEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).IsTokenEnabled = value; } /// Internal Acessors for Key - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal.Key { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).Key; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).Key = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal.Key { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).Key; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).Key = value; } /// Internal Acessors for Key2 - string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal.Key2 { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).Key2; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).Key2 = value; } + string Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal.Key2 { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).Key2; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).Key2 = value; } /// Site name [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).Name = value ; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).Name = value ; } /// /// List of Trusted Origin URLs for this site. This field is applicable only if isSecureSiteEnabled is True. /// [Microsoft.Azure.PowerShell.Cmdlets.BotService.Origin(Microsoft.Azure.PowerShell.Cmdlets.BotService.PropertyOrigin.Inherited)] - public string[] TrustedOrigin { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).TrustedOrigin; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal)__site).TrustedOrigin = value ?? null /* arrayOf */; } + public System.Collections.Generic.List TrustedOrigin { get => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).TrustedOrigin; set => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal)__site).TrustedOrigin = value ?? null /* arrayOf */; } /// Validates that this object meets the validation criteria. /// an instance that will receive validation @@ -126,13 +125,13 @@ public WebChatSite() /// A site for the Webchat channel public partial interface IWebChatSite : Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISite + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISite { } /// A site for the Webchat channel internal partial interface IWebChatSiteInternal : - Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInternal + Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInternal { } diff --git a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/WebChatSite.json.cs b/generated/BotService/BotService.Autorest/generated/api/Models/WebChatSite.json.cs similarity index 94% rename from generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/WebChatSite.json.cs rename to generated/BotService/BotService.Autorest/generated/api/Models/WebChatSite.json.cs index 714947699e3e..877c1f6becc5 100644 --- a/generated/BotService/BotService.Autorest/generated/api/Models/Api20220615Preview/WebChatSite.json.cs +++ b/generated/BotService/BotService.Autorest/generated/api/Models/WebChatSite.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.BotService.Models.Api20220615Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Models { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WebChatSite partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IWebChatSite. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatSite. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IWebChatSite. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatSite. /// - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IWebChatSite FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IWebChatSite FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonObject json ? new WebChatSite(json) : null; } @@ -101,7 +101,7 @@ internal WebChatSite(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json. { return; } - __site = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Site(json); + __site = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Site(json); AfterFromJson(json); } } diff --git a/generated/BotService/BotService.Autorest/generated/api/Support/ChannelName.Completer.cs b/generated/BotService/BotService.Autorest/generated/api/Support/ChannelName.Completer.cs deleted file mode 100644 index 544b7f5c7370..000000000000 --- a/generated/BotService/BotService.Autorest/generated/api/Support/ChannelName.Completer.cs +++ /dev/null @@ -1,95 +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.BotService.Support -{ - - /// Argument completer implementation for ChannelName. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.ChannelNameTypeConverter))] - public partial struct ChannelName : - 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) || "AlexaChannel".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'AlexaChannel'", "AlexaChannel", global::System.Management.Automation.CompletionResultType.ParameterValue, "AlexaChannel"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "FacebookChannel".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'FacebookChannel'", "FacebookChannel", global::System.Management.Automation.CompletionResultType.ParameterValue, "FacebookChannel"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "EmailChannel".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'EmailChannel'", "EmailChannel", global::System.Management.Automation.CompletionResultType.ParameterValue, "EmailChannel"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "KikChannel".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'KikChannel'", "KikChannel", global::System.Management.Automation.CompletionResultType.ParameterValue, "KikChannel"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "TelegramChannel".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'TelegramChannel'", "TelegramChannel", global::System.Management.Automation.CompletionResultType.ParameterValue, "TelegramChannel"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "SlackChannel".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'SlackChannel'", "SlackChannel", global::System.Management.Automation.CompletionResultType.ParameterValue, "SlackChannel"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "MsTeamsChannel".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'MsTeamsChannel'", "MsTeamsChannel", global::System.Management.Automation.CompletionResultType.ParameterValue, "MsTeamsChannel"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "SkypeChannel".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'SkypeChannel'", "SkypeChannel", global::System.Management.Automation.CompletionResultType.ParameterValue, "SkypeChannel"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "WebChatChannel".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'WebChatChannel'", "WebChatChannel", global::System.Management.Automation.CompletionResultType.ParameterValue, "WebChatChannel"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "DirectLineChannel".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'DirectLineChannel'", "DirectLineChannel", global::System.Management.Automation.CompletionResultType.ParameterValue, "DirectLineChannel"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "SmsChannel".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'SmsChannel'", "SmsChannel", global::System.Management.Automation.CompletionResultType.ParameterValue, "SmsChannel"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "LineChannel".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'LineChannel'", "LineChannel", global::System.Management.Automation.CompletionResultType.ParameterValue, "LineChannel"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "DirectLineSpeechChannel".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'DirectLineSpeechChannel'", "DirectLineSpeechChannel", global::System.Management.Automation.CompletionResultType.ParameterValue, "DirectLineSpeechChannel"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "OutlookChannel".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'OutlookChannel'", "OutlookChannel", global::System.Management.Automation.CompletionResultType.ParameterValue, "OutlookChannel"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Omnichannel".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Omnichannel'", "Omnichannel", global::System.Management.Automation.CompletionResultType.ParameterValue, "Omnichannel"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "TelephonyChannel".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'TelephonyChannel'", "TelephonyChannel", global::System.Management.Automation.CompletionResultType.ParameterValue, "TelephonyChannel"); - } - } - } -} \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/api/Support/ChannelName.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Support/ChannelName.TypeConverter.cs deleted file mode 100644 index 48cf28aede2f..000000000000 --- a/generated/BotService/BotService.Autorest/generated/api/Support/ChannelName.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.BotService.Support -{ - - /// TypeConverter implementation for ChannelName. - public partial class ChannelNameTypeConverter : - 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) => ChannelName.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/BotService/BotService.Autorest/generated/api/Support/ChannelName.cs b/generated/BotService/BotService.Autorest/generated/api/Support/ChannelName.cs deleted file mode 100644 index d26427c31612..000000000000 --- a/generated/BotService/BotService.Autorest/generated/api/Support/ChannelName.cs +++ /dev/null @@ -1,125 +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.BotService.Support -{ - - public partial struct ChannelName : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.ChannelName AlexaChannel = @"AlexaChannel"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.ChannelName DirectLineChannel = @"DirectLineChannel"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.ChannelName DirectLineSpeechChannel = @"DirectLineSpeechChannel"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.ChannelName EmailChannel = @"EmailChannel"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.ChannelName FacebookChannel = @"FacebookChannel"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.ChannelName KikChannel = @"KikChannel"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.ChannelName LineChannel = @"LineChannel"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.ChannelName MSTeamsChannel = @"MsTeamsChannel"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.ChannelName Omnichannel = @"Omnichannel"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.ChannelName OutlookChannel = @"OutlookChannel"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.ChannelName SkypeChannel = @"SkypeChannel"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.ChannelName SlackChannel = @"SlackChannel"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.ChannelName SmsChannel = @"SmsChannel"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.ChannelName TelegramChannel = @"TelegramChannel"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.ChannelName TelephonyChannel = @"TelephonyChannel"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.ChannelName WebChatChannel = @"WebChatChannel"; - - /// 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 ChannelName(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to ChannelName - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ChannelName(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ChannelName - /// 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.BotService.Support.ChannelName e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type ChannelName (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 ChannelName && Equals((ChannelName)obj); - } - - /// Returns hashCode for enum ChannelName - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for ChannelName - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to ChannelName - /// the value to convert to an instance of . - - public static implicit operator ChannelName(string value) - { - return new ChannelName(value); - } - - /// Implicit operator to convert ChannelName to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.ChannelName e) - { - return e._value; - } - - /// Overriding != operator for enum ChannelName - /// 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.BotService.Support.ChannelName e1, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.ChannelName e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ChannelName - /// 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.BotService.Support.ChannelName e1, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.ChannelName e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/api/Support/Key.Completer.cs b/generated/BotService/BotService.Autorest/generated/api/Support/Key.Completer.cs deleted file mode 100644 index 92529e55f008..000000000000 --- a/generated/BotService/BotService.Autorest/generated/api/Support/Key.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.BotService.Support -{ - - /// Determines which key is to be regenerated - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.KeyTypeConverter))] - public partial struct Key : - 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) || "key1".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'key1'", "key1", global::System.Management.Automation.CompletionResultType.ParameterValue, "key1"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "key2".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'key2'", "key2", global::System.Management.Automation.CompletionResultType.ParameterValue, "key2"); - } - } - } -} \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/api/Support/Key.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Support/Key.TypeConverter.cs deleted file mode 100644 index 1075a6630c13..000000000000 --- a/generated/BotService/BotService.Autorest/generated/api/Support/Key.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.BotService.Support -{ - - /// Determines which key is to be regenerated - public partial class KeyTypeConverter : - 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) => Key.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/BotService/BotService.Autorest/generated/api/Support/Key.cs b/generated/BotService/BotService.Autorest/generated/api/Support/Key.cs deleted file mode 100644 index 93928ce61e1d..000000000000 --- a/generated/BotService/BotService.Autorest/generated/api/Support/Key.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.BotService.Support -{ - - /// Determines which key is to be regenerated - public partial struct Key : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Key Key1 = @"key1"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Key Key2 = @"key2"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to Key - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new Key(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type Key - /// 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.BotService.Support.Key e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type Key (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 Key && Equals((Key)obj); - } - - /// Returns hashCode for enum Key - /// 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 Key(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for Key - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to Key - /// the value to convert to an instance of . - - public static implicit operator Key(string value) - { - return new Key(value); - } - - /// Implicit operator to convert Key to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Key e) - { - return e._value; - } - - /// Overriding != operator for enum Key - /// 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.BotService.Support.Key e1, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Key e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum Key - /// 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.BotService.Support.Key e1, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Key e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/api/Support/Kind.Completer.cs b/generated/BotService/BotService.Autorest/generated/api/Support/Kind.Completer.cs deleted file mode 100644 index 16c22e03914c..000000000000 --- a/generated/BotService/BotService.Autorest/generated/api/Support/Kind.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.BotService.Support -{ - - /// Indicates the type of bot service - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.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) || "sdk".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'sdk'", "sdk", global::System.Management.Automation.CompletionResultType.ParameterValue, "sdk"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "designer".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'designer'", "designer", global::System.Management.Automation.CompletionResultType.ParameterValue, "designer"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "bot".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'bot'", "bot", global::System.Management.Automation.CompletionResultType.ParameterValue, "bot"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "function".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'function'", "function", global::System.Management.Automation.CompletionResultType.ParameterValue, "function"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "azurebot".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'azurebot'", "azurebot", global::System.Management.Automation.CompletionResultType.ParameterValue, "azurebot"); - } - } - } -} \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/api/Support/Kind.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Support/Kind.TypeConverter.cs deleted file mode 100644 index b9fc3fec3e23..000000000000 --- a/generated/BotService/BotService.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.BotService.Support -{ - - /// Indicates the type of bot service - 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/BotService/BotService.Autorest/generated/api/Support/Kind.cs b/generated/BotService/BotService.Autorest/generated/api/Support/Kind.cs deleted file mode 100644 index 5b08d9c6d024..000000000000 --- a/generated/BotService/BotService.Autorest/generated/api/Support/Kind.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.BotService.Support -{ - - /// Indicates the type of bot service - public partial struct Kind : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Kind Azurebot = @"azurebot"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Kind Bot = @"bot"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Kind Designer = @"designer"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Kind Function = @"function"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Kind Sdk = @"sdk"; - - /// 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.BotService.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.BotService.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.BotService.Support.Kind e1, Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Support.Kind e1, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Kind e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/api/Support/MsaAppType.Completer.cs b/generated/BotService/BotService.Autorest/generated/api/Support/MsaAppType.Completer.cs deleted file mode 100644 index ce97472c0fac..000000000000 --- a/generated/BotService/BotService.Autorest/generated/api/Support/MsaAppType.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.BotService.Support -{ - - /// Microsoft App Type for the bot - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.MsaAppTypeTypeConverter))] - public partial struct MsaAppType : - 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) || "UserAssignedMSI".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'UserAssignedMSI'", "UserAssignedMSI", global::System.Management.Automation.CompletionResultType.ParameterValue, "UserAssignedMSI"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "SingleTenant".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'SingleTenant'", "SingleTenant", global::System.Management.Automation.CompletionResultType.ParameterValue, "SingleTenant"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "MultiTenant".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'MultiTenant'", "MultiTenant", global::System.Management.Automation.CompletionResultType.ParameterValue, "MultiTenant"); - } - } - } -} \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/api/Support/MsaAppType.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Support/MsaAppType.TypeConverter.cs deleted file mode 100644 index 4badb1026619..000000000000 --- a/generated/BotService/BotService.Autorest/generated/api/Support/MsaAppType.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.BotService.Support -{ - - /// Microsoft App Type for the bot - public partial class MsaAppTypeTypeConverter : - 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) => MsaAppType.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/BotService/BotService.Autorest/generated/api/Support/MsaAppType.cs b/generated/BotService/BotService.Autorest/generated/api/Support/MsaAppType.cs deleted file mode 100644 index ba15794d4354..000000000000 --- a/generated/BotService/BotService.Autorest/generated/api/Support/MsaAppType.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.BotService.Support -{ - - /// Microsoft App Type for the bot - public partial struct MsaAppType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.MsaAppType MultiTenant = @"MultiTenant"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.MsaAppType SingleTenant = @"SingleTenant"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.MsaAppType UserAssignedMsi = @"UserAssignedMSI"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to MsaAppType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new MsaAppType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type MsaAppType - /// 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.BotService.Support.MsaAppType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type MsaAppType (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 MsaAppType && Equals((MsaAppType)obj); - } - - /// Returns hashCode for enum MsaAppType - /// 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 MsaAppType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for MsaAppType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to MsaAppType - /// the value to convert to an instance of . - - public static implicit operator MsaAppType(string value) - { - return new MsaAppType(value); - } - - /// Implicit operator to convert MsaAppType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.MsaAppType e) - { - return e._value; - } - - /// Overriding != operator for enum MsaAppType - /// 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.BotService.Support.MsaAppType e1, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.MsaAppType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum MsaAppType - /// 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.BotService.Support.MsaAppType e1, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.MsaAppType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/api/Support/OperationResultStatus.Completer.cs b/generated/BotService/BotService.Autorest/generated/api/Support/OperationResultStatus.Completer.cs deleted file mode 100644 index 65da345f7b00..000000000000 --- a/generated/BotService/BotService.Autorest/generated/api/Support/OperationResultStatus.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.BotService.Support -{ - - /// The status of the operation being performed. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.OperationResultStatusTypeConverter))] - public partial struct OperationResultStatus : - 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) || "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) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Failed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Failed'", "Failed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Failed"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Requested".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Requested'", "Requested", global::System.Management.Automation.CompletionResultType.ParameterValue, "Requested"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Running".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Running'", "Running", global::System.Management.Automation.CompletionResultType.ParameterValue, "Running"); - } - } - } -} \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/api/Support/OperationResultStatus.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Support/OperationResultStatus.TypeConverter.cs deleted file mode 100644 index 12c44213a613..000000000000 --- a/generated/BotService/BotService.Autorest/generated/api/Support/OperationResultStatus.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.BotService.Support -{ - - /// The status of the operation being performed. - public partial class OperationResultStatusTypeConverter : - 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) => OperationResultStatus.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/BotService/BotService.Autorest/generated/api/Support/OperationResultStatus.cs b/generated/BotService/BotService.Autorest/generated/api/Support/OperationResultStatus.cs deleted file mode 100644 index 2d907703e825..000000000000 --- a/generated/BotService/BotService.Autorest/generated/api/Support/OperationResultStatus.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.BotService.Support -{ - - /// The status of the operation being performed. - public partial struct OperationResultStatus : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.OperationResultStatus Canceled = @"Canceled"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.OperationResultStatus Failed = @"Failed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.OperationResultStatus Requested = @"Requested"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.OperationResultStatus Running = @"Running"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.OperationResultStatus Succeeded = @"Succeeded"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to OperationResultStatus - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new OperationResultStatus(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type OperationResultStatus - /// 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.BotService.Support.OperationResultStatus e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type OperationResultStatus (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 OperationResultStatus && Equals((OperationResultStatus)obj); - } - - /// Returns hashCode for enum OperationResultStatus - /// 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 OperationResultStatus(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for OperationResultStatus - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to OperationResultStatus - /// the value to convert to an instance of . - - public static implicit operator OperationResultStatus(string value) - { - return new OperationResultStatus(value); - } - - /// Implicit operator to convert OperationResultStatus to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.OperationResultStatus e) - { - return e._value; - } - - /// Overriding != operator for enum OperationResultStatus - /// 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.BotService.Support.OperationResultStatus e1, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.OperationResultStatus e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum OperationResultStatus - /// 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.BotService.Support.OperationResultStatus e1, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.OperationResultStatus e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/api/Support/PrivateEndpointConnectionProvisioningState.Completer.cs b/generated/BotService/BotService.Autorest/generated/api/Support/PrivateEndpointConnectionProvisioningState.Completer.cs deleted file mode 100644 index 197bcc24133f..000000000000 --- a/generated/BotService/BotService.Autorest/generated/api/Support/PrivateEndpointConnectionProvisioningState.Completer.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Support -{ - - /// The current provisioning state. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointConnectionProvisioningStateTypeConverter))] - public partial struct PrivateEndpointConnectionProvisioningState : - System.Management.Automation.IArgumentCompleter - { - - /// - /// Implementations of this function are called by PowerShell to complete arguments. - /// - /// The name of the command that needs argument completion. - /// The name of the parameter that needs argument completion. - /// The (possibly empty) word being completed. - /// The command ast in case it is needed for completion. - /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot - /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. - /// - /// A collection of completion results, most like with ResultType set to ParameterValue. - /// - public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) - { - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Creating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Creating'", "Creating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Creating"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Deleting".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Deleting'", "Deleting", global::System.Management.Automation.CompletionResultType.ParameterValue, "Deleting"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Failed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Failed'", "Failed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Failed"); - } - } - } -} \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/api/Support/PrivateEndpointConnectionProvisioningState.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Support/PrivateEndpointConnectionProvisioningState.TypeConverter.cs deleted file mode 100644 index 4cfd11144c4f..000000000000 --- a/generated/BotService/BotService.Autorest/generated/api/Support/PrivateEndpointConnectionProvisioningState.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Support -{ - - /// The current provisioning state. - public partial class PrivateEndpointConnectionProvisioningStateTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => PrivateEndpointConnectionProvisioningState.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/api/Support/PrivateEndpointConnectionProvisioningState.cs b/generated/BotService/BotService.Autorest/generated/api/Support/PrivateEndpointConnectionProvisioningState.cs deleted file mode 100644 index 7209786c0420..000000000000 --- a/generated/BotService/BotService.Autorest/generated/api/Support/PrivateEndpointConnectionProvisioningState.cs +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Support -{ - - /// The current provisioning state. - public partial struct PrivateEndpointConnectionProvisioningState : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointConnectionProvisioningState Creating = @"Creating"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointConnectionProvisioningState Deleting = @"Deleting"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointConnectionProvisioningState Failed = @"Failed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointConnectionProvisioningState Succeeded = @"Succeeded"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to PrivateEndpointConnectionProvisioningState - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new PrivateEndpointConnectionProvisioningState(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type PrivateEndpointConnectionProvisioningState - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointConnectionProvisioningState e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type PrivateEndpointConnectionProvisioningState (override for Object) - /// - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public override bool Equals(object obj) - { - return obj is PrivateEndpointConnectionProvisioningState && Equals((PrivateEndpointConnectionProvisioningState)obj); - } - - /// Returns hashCode for enum PrivateEndpointConnectionProvisioningState - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// - /// Creates an instance of the Enum class. - /// - /// the value to create an instance for. - private PrivateEndpointConnectionProvisioningState(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for PrivateEndpointConnectionProvisioningState - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// - /// Implicit operator to convert string to PrivateEndpointConnectionProvisioningState - /// - /// the value to convert to an instance of . - - public static implicit operator PrivateEndpointConnectionProvisioningState(string value) - { - return new PrivateEndpointConnectionProvisioningState(value); - } - - /// - /// Implicit operator to convert PrivateEndpointConnectionProvisioningState to string - /// - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointConnectionProvisioningState e) - { - return e._value; - } - - /// Overriding != operator for enum PrivateEndpointConnectionProvisioningState - /// the value to compare against - /// the value to compare against - /// true if the two instances are not equal to the same value - public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointConnectionProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointConnectionProvisioningState e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum PrivateEndpointConnectionProvisioningState - /// the value to compare against - /// the value to compare against - /// true if the two instances are equal to the same value - public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointConnectionProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointConnectionProvisioningState e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/api/Support/PrivateEndpointServiceConnectionStatus.Completer.cs b/generated/BotService/BotService.Autorest/generated/api/Support/PrivateEndpointServiceConnectionStatus.Completer.cs deleted file mode 100644 index b022d4f1c70d..000000000000 --- a/generated/BotService/BotService.Autorest/generated/api/Support/PrivateEndpointServiceConnectionStatus.Completer.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Support -{ - - /// The private endpoint connection status. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointServiceConnectionStatusTypeConverter))] - public partial struct PrivateEndpointServiceConnectionStatus : - System.Management.Automation.IArgumentCompleter - { - - /// - /// Implementations of this function are called by PowerShell to complete arguments. - /// - /// The name of the command that needs argument completion. - /// The name of the parameter that needs argument completion. - /// The (possibly empty) word being completed. - /// The command ast in case it is needed for completion. - /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot - /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. - /// - /// A collection of completion results, most like with ResultType set to ParameterValue. - /// - public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) - { - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Pending".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Pending'", "Pending", global::System.Management.Automation.CompletionResultType.ParameterValue, "Pending"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Approved".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Approved'", "Approved", global::System.Management.Automation.CompletionResultType.ParameterValue, "Approved"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Rejected".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Rejected'", "Rejected", global::System.Management.Automation.CompletionResultType.ParameterValue, "Rejected"); - } - } - } -} \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/api/Support/PrivateEndpointServiceConnectionStatus.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Support/PrivateEndpointServiceConnectionStatus.TypeConverter.cs deleted file mode 100644 index 5f1e927ef882..000000000000 --- a/generated/BotService/BotService.Autorest/generated/api/Support/PrivateEndpointServiceConnectionStatus.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Support -{ - - /// The private endpoint connection status. - public partial class PrivateEndpointServiceConnectionStatusTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => PrivateEndpointServiceConnectionStatus.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/api/Support/PrivateEndpointServiceConnectionStatus.cs b/generated/BotService/BotService.Autorest/generated/api/Support/PrivateEndpointServiceConnectionStatus.cs deleted file mode 100644 index 196b233a6dfd..000000000000 --- a/generated/BotService/BotService.Autorest/generated/api/Support/PrivateEndpointServiceConnectionStatus.cs +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Support -{ - - /// The private endpoint connection status. - public partial struct PrivateEndpointServiceConnectionStatus : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointServiceConnectionStatus Approved = @"Approved"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointServiceConnectionStatus Pending = @"Pending"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointServiceConnectionStatus Rejected = @"Rejected"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to PrivateEndpointServiceConnectionStatus - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new PrivateEndpointServiceConnectionStatus(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type PrivateEndpointServiceConnectionStatus - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointServiceConnectionStatus e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type PrivateEndpointServiceConnectionStatus (override for Object) - /// - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public override bool Equals(object obj) - { - return obj is PrivateEndpointServiceConnectionStatus && Equals((PrivateEndpointServiceConnectionStatus)obj); - } - - /// Returns hashCode for enum PrivateEndpointServiceConnectionStatus - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// - /// Creates an instance of the Enum class. - /// - /// the value to create an instance for. - private PrivateEndpointServiceConnectionStatus(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for PrivateEndpointServiceConnectionStatus - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to PrivateEndpointServiceConnectionStatus - /// the value to convert to an instance of . - - public static implicit operator PrivateEndpointServiceConnectionStatus(string value) - { - return new PrivateEndpointServiceConnectionStatus(value); - } - - /// Implicit operator to convert PrivateEndpointServiceConnectionStatus to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointServiceConnectionStatus e) - { - return e._value; - } - - /// Overriding != operator for enum PrivateEndpointServiceConnectionStatus - /// the value to compare against - /// the value to compare against - /// true if the two instances are not equal to the same value - public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointServiceConnectionStatus e1, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointServiceConnectionStatus e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum PrivateEndpointServiceConnectionStatus - /// the value to compare against - /// the value to compare against - /// true if the two instances are equal to the same value - public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointServiceConnectionStatus e1, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointServiceConnectionStatus e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/api/Support/PublicNetworkAccess.Completer.cs b/generated/BotService/BotService.Autorest/generated/api/Support/PublicNetworkAccess.Completer.cs deleted file mode 100644 index 5c98f6ad03c9..000000000000 --- a/generated/BotService/BotService.Autorest/generated/api/Support/PublicNetworkAccess.Completer.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Support -{ - - /// Whether the bot is in an isolated network - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PublicNetworkAccessTypeConverter))] - public partial struct PublicNetworkAccess : - System.Management.Automation.IArgumentCompleter - { - - /// - /// Implementations of this function are called by PowerShell to complete arguments. - /// - /// The name of the command that needs argument completion. - /// The name of the parameter that needs argument completion. - /// The (possibly empty) word being completed. - /// The command ast in case it is needed for completion. - /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot - /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. - /// - /// A collection of completion results, most like with ResultType set to ParameterValue. - /// - public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) - { - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Enabled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Enabled'", "Enabled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Enabled"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Disabled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Disabled'", "Disabled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Disabled"); - } - } - } -} \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/api/Support/PublicNetworkAccess.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Support/PublicNetworkAccess.TypeConverter.cs deleted file mode 100644 index d5bd53683c60..000000000000 --- a/generated/BotService/BotService.Autorest/generated/api/Support/PublicNetworkAccess.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Support -{ - - /// Whether the bot is in an isolated network - public partial class PublicNetworkAccessTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => PublicNetworkAccess.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/api/Support/PublicNetworkAccess.cs b/generated/BotService/BotService.Autorest/generated/api/Support/PublicNetworkAccess.cs deleted file mode 100644 index c42012678fcc..000000000000 --- a/generated/BotService/BotService.Autorest/generated/api/Support/PublicNetworkAccess.cs +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Support -{ - - /// Whether the bot is in an isolated network - public partial struct PublicNetworkAccess : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PublicNetworkAccess Disabled = @"Disabled"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PublicNetworkAccess Enabled = @"Enabled"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to PublicNetworkAccess - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new PublicNetworkAccess(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type PublicNetworkAccess - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PublicNetworkAccess e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type PublicNetworkAccess (override for Object) - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public override bool Equals(object obj) - { - return obj is PublicNetworkAccess && Equals((PublicNetworkAccess)obj); - } - - /// Returns hashCode for enum PublicNetworkAccess - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private PublicNetworkAccess(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for PublicNetworkAccess - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to PublicNetworkAccess - /// the value to convert to an instance of . - - public static implicit operator PublicNetworkAccess(string value) - { - return new PublicNetworkAccess(value); - } - - /// Implicit operator to convert PublicNetworkAccess to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PublicNetworkAccess e) - { - return e._value; - } - - /// Overriding != operator for enum PublicNetworkAccess - /// the value to compare against - /// the value to compare against - /// true if the two instances are not equal to the same value - public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PublicNetworkAccess e1, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PublicNetworkAccess e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum PublicNetworkAccess - /// the value to compare against - /// the value to compare against - /// true if the two instances are equal to the same value - public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PublicNetworkAccess e1, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PublicNetworkAccess e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/api/Support/RegenerateKeysChannelName.Completer.cs b/generated/BotService/BotService.Autorest/generated/api/Support/RegenerateKeysChannelName.Completer.cs deleted file mode 100644 index d47fe2132e71..000000000000 --- a/generated/BotService/BotService.Autorest/generated/api/Support/RegenerateKeysChannelName.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.BotService.Support -{ - - /// Argument completer implementation for RegenerateKeysChannelName. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.RegenerateKeysChannelNameTypeConverter))] - public partial struct RegenerateKeysChannelName : - 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) || "WebChatChannel".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'WebChatChannel'", "WebChatChannel", global::System.Management.Automation.CompletionResultType.ParameterValue, "WebChatChannel"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "DirectLineChannel".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'DirectLineChannel'", "DirectLineChannel", global::System.Management.Automation.CompletionResultType.ParameterValue, "DirectLineChannel"); - } - } - } -} \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/api/Support/RegenerateKeysChannelName.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Support/RegenerateKeysChannelName.TypeConverter.cs deleted file mode 100644 index f477a961058f..000000000000 --- a/generated/BotService/BotService.Autorest/generated/api/Support/RegenerateKeysChannelName.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.BotService.Support -{ - - /// TypeConverter implementation for RegenerateKeysChannelName. - public partial class RegenerateKeysChannelNameTypeConverter : - 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) => RegenerateKeysChannelName.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/BotService/BotService.Autorest/generated/api/Support/RegenerateKeysChannelName.cs b/generated/BotService/BotService.Autorest/generated/api/Support/RegenerateKeysChannelName.cs deleted file mode 100644 index 7674c1151c33..000000000000 --- a/generated/BotService/BotService.Autorest/generated/api/Support/RegenerateKeysChannelName.cs +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Support -{ - - public partial struct RegenerateKeysChannelName : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.RegenerateKeysChannelName DirectLineChannel = @"DirectLineChannel"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.RegenerateKeysChannelName WebChatChannel = @"WebChatChannel"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to RegenerateKeysChannelName - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new RegenerateKeysChannelName(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type RegenerateKeysChannelName - /// 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.BotService.Support.RegenerateKeysChannelName e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type RegenerateKeysChannelName (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 RegenerateKeysChannelName && Equals((RegenerateKeysChannelName)obj); - } - - /// Returns hashCode for enum RegenerateKeysChannelName - /// 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 RegenerateKeysChannelName(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for RegenerateKeysChannelName - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to RegenerateKeysChannelName - /// the value to convert to an instance of . - - public static implicit operator RegenerateKeysChannelName(string value) - { - return new RegenerateKeysChannelName(value); - } - - /// Implicit operator to convert RegenerateKeysChannelName to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.RegenerateKeysChannelName e) - { - return e._value; - } - - /// Overriding != operator for enum RegenerateKeysChannelName - /// 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.BotService.Support.RegenerateKeysChannelName e1, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.RegenerateKeysChannelName e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum RegenerateKeysChannelName - /// 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.BotService.Support.RegenerateKeysChannelName e1, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.RegenerateKeysChannelName e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/api/Support/SkuName.Completer.cs b/generated/BotService/BotService.Autorest/generated/api/Support/SkuName.Completer.cs deleted file mode 100644 index 47a7ab9fbc55..000000000000 --- a/generated/BotService/BotService.Autorest/generated/api/Support/SkuName.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.BotService.Support -{ - - /// The name of SKU. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuNameTypeConverter))] - public partial struct SkuName : - 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) || "F0".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'F0'", "F0", global::System.Management.Automation.CompletionResultType.ParameterValue, "F0"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "S1".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'S1'", "S1", global::System.Management.Automation.CompletionResultType.ParameterValue, "S1"); - } - } - } -} \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/api/Support/SkuName.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Support/SkuName.TypeConverter.cs deleted file mode 100644 index e8ede9b4e980..000000000000 --- a/generated/BotService/BotService.Autorest/generated/api/Support/SkuName.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.BotService.Support -{ - - /// The name of SKU. - public partial class SkuNameTypeConverter : - 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) => SkuName.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/BotService/BotService.Autorest/generated/api/Support/SkuName.cs b/generated/BotService/BotService.Autorest/generated/api/Support/SkuName.cs deleted file mode 100644 index f64711aafb22..000000000000 --- a/generated/BotService/BotService.Autorest/generated/api/Support/SkuName.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.BotService.Support -{ - - /// The name of SKU. - public partial struct SkuName : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName F0 = @"F0"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName S1 = @"S1"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to SkuName - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new SkuName(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type SkuName - /// 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.BotService.Support.SkuName e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type SkuName (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 SkuName && Equals((SkuName)obj); - } - - /// Returns hashCode for enum SkuName - /// 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 SkuName(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for SkuName - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to SkuName - /// the value to convert to an instance of . - - public static implicit operator SkuName(string value) - { - return new SkuName(value); - } - - /// Implicit operator to convert SkuName to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName e) - { - return e._value; - } - - /// Overriding != operator for enum SkuName - /// 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.BotService.Support.SkuName e1, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum SkuName - /// 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.BotService.Support.SkuName e1, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/api/Support/SkuTier.Completer.cs b/generated/BotService/BotService.Autorest/generated/api/Support/SkuTier.Completer.cs deleted file mode 100644 index 20a83f54f79a..000000000000 --- a/generated/BotService/BotService.Autorest/generated/api/Support/SkuTier.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.BotService.Support -{ - - /// Gets the sku tier. This is based on the SKU name. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuTierTypeConverter))] - public partial struct SkuTier : - 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) || "Free".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Free'", "Free", global::System.Management.Automation.CompletionResultType.ParameterValue, "Free"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Standard".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Standard'", "Standard", global::System.Management.Automation.CompletionResultType.ParameterValue, "Standard"); - } - } - } -} \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/api/Support/SkuTier.TypeConverter.cs b/generated/BotService/BotService.Autorest/generated/api/Support/SkuTier.TypeConverter.cs deleted file mode 100644 index 60f933e29f89..000000000000 --- a/generated/BotService/BotService.Autorest/generated/api/Support/SkuTier.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.BotService.Support -{ - - /// Gets the sku tier. This is based on the SKU name. - public partial class SkuTierTypeConverter : - 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) => SkuTier.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/BotService/BotService.Autorest/generated/api/Support/SkuTier.cs b/generated/BotService/BotService.Autorest/generated/api/Support/SkuTier.cs deleted file mode 100644 index 6501996ba9e6..000000000000 --- a/generated/BotService/BotService.Autorest/generated/api/Support/SkuTier.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.BotService.Support -{ - - /// Gets the sku tier. This is based on the SKU name. - public partial struct SkuTier : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuTier Free = @"Free"; - - public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuTier Standard = @"Standard"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to SkuTier - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new SkuTier(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type SkuTier - /// 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.BotService.Support.SkuTier e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type SkuTier (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 SkuTier && Equals((SkuTier)obj); - } - - /// Returns hashCode for enum SkuTier - /// 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 SkuTier(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for SkuTier - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to SkuTier - /// the value to convert to an instance of . - - public static implicit operator SkuTier(string value) - { - return new SkuTier(value); - } - - /// Implicit operator to convert SkuTier to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuTier e) - { - return e._value; - } - - /// Overriding != operator for enum SkuTier - /// 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.BotService.Support.SkuTier e1, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuTier e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum SkuTier - /// 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.BotService.Support.SkuTier e1, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuTier e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/cmdlets/GetAzBotServiceCheckNameAvailability_Get.cs b/generated/BotService/BotService.Autorest/generated/cmdlets/GetAzBotServiceCheckNameAvailability_Get.cs index 5a88a1e5fe6d..21dab6515cb8 100644 --- a/generated/BotService/BotService.Autorest/generated/cmdlets/GetAzBotServiceCheckNameAvailability_Get.cs +++ b/generated/BotService/BotService.Autorest/generated/cmdlets/GetAzBotServiceCheckNameAvailability_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Cmdlets; using System; /// Check whether a bot name is available. @@ -14,12 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzBotServiceCheckNameAvailability_Get", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICheckNameAvailabilityResponseBody))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityResponseBody))] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Description(@"Check whether a bot name is available.")] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.HttpPath(Path = "/providers/Microsoft.BotService/checkNameAvailability", ApiVersion = "2022-06-15-preview")] public partial class GetAzBotServiceCheckNameAvailability_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.BotService.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 GetAzBotServiceCheckNameAvailability_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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.BotService Client => Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.ClientAPI; @@ -53,6 +71,9 @@ public partial class GetAzBotServiceCheckNameAvailability_Get : global::System.M [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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] @@ -77,7 +98,7 @@ public partial class GetAzBotServiceCheckNameAvailability_Get : global::System.M global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICheckNameAvailabilityRequestBody _parameter; + private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityRequestBody _parameter; /// /// The request body for a request to Bot Service Management to check availability of a bot name. @@ -88,13 +109,14 @@ public partial class GetAzBotServiceCheckNameAvailability_Get : global::System.M ReadOnly = false, Description = @"The request body for a request to Bot Service Management to check availability of a bot name.", SerializedName = @"parameters", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICheckNameAvailabilityRequestBody) })] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICheckNameAvailabilityRequestBody Parameter { get => this._parameter; set => this._parameter = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityRequestBody) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Body)] + public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityRequestBody Parameter { get => this._parameter; set => this._parameter = value; } /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.BotService.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,24 +139,24 @@ public partial class GetAzBotServiceCheckNameAvailability_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.BotService.Models.Api20220615Preview.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IError /// 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.BotService.Models.Api20220615Preview.ICheckNameAvailabilityResponseBody + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityResponseBody /// 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) @@ -157,6 +179,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.BotService.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -178,7 +205,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzBotServiceCheckNameAvailability_Get() { @@ -229,8 +256,33 @@ public GetAzBotServiceCheckNameAvailability_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.BotService.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.BotService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -286,7 +338,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -304,7 +356,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.BotService.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 { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -342,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.BotService.Models.Api20220615Preview.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IError /// 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 ) { @@ -364,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.BotService.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.BotService.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 } }); @@ -382,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.BotService.Models.Api20220615Preview.ICheckNameAvailabilityResponseBody + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityResponseBody /// 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 ) { @@ -399,8 +451,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICheckNameAvailabilityResponseBody - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityResponseBody + 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/BotService/BotService.Autorest/generated/cmdlets/GetAzBotServiceCheckNameAvailability_GetExpanded.cs b/generated/BotService/BotService.Autorest/generated/cmdlets/GetAzBotServiceCheckNameAvailability_GetExpanded.cs index 5d13d11b1266..4b601d02d7aa 100644 --- a/generated/BotService/BotService.Autorest/generated/cmdlets/GetAzBotServiceCheckNameAvailability_GetExpanded.cs +++ b/generated/BotService/BotService.Autorest/generated/cmdlets/GetAzBotServiceCheckNameAvailability_GetExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Cmdlets; using System; /// Check whether a bot name is available. @@ -14,12 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzBotServiceCheckNameAvailability_GetExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICheckNameAvailabilityResponseBody))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityResponseBody))] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Description(@"Check whether a bot name is available.")] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.HttpPath(Path = "/providers/Microsoft.BotService/checkNameAvailability", ApiVersion = "2022-06-15-preview")] public partial class GetAzBotServiceCheckNameAvailability_GetExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,16 +38,31 @@ public partial class GetAzBotServiceCheckNameAvailability_GetExpanded : 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 request body for a request to Bot Service Management to check availability of a bot name. /// - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICheckNameAvailabilityRequestBody _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.CheckNameAvailabilityRequestBody(); + private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityRequestBody _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.CheckNameAvailabilityRequestBody(); + + /// + /// 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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.BotService Client => Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.ClientAPI; @@ -58,6 +76,9 @@ public partial class GetAzBotServiceCheckNameAvailability_GetExpanded : global:: [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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 GetAzBotServiceCheckNameAvailability_GetExpanded : global:: /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -129,24 +150,24 @@ public partial class GetAzBotServiceCheckNameAvailability_GetExpanded : 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.BotService.Models.Api20220615Preview.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IError /// 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.BotService.Models.Api20220615Preview.ICheckNameAvailabilityResponseBody + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityResponseBody /// 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) @@ -169,6 +190,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.BotService.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -190,7 +216,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzBotServiceCheckNameAvailability_GetExpanded() { @@ -241,8 +267,33 @@ public GetAzBotServiceCheckNameAvailability_GetExpanded() 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.BotService.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.BotService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -316,7 +367,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.BotService.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 } }); @@ -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.BotService.Models.Api20220615Preview.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IError /// 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.BotService.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.BotService.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 } }); @@ -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.BotService.Models.Api20220615Preview.ICheckNameAvailabilityResponseBody + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityResponseBody /// 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.BotService.Models.Api20220615Preview.ICheckNameAvailabilityResponseBody - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityResponseBody + 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/BotService/BotService.Autorest/generated/cmdlets/GetAzBotServiceQnAMakerEndpointKey_GetViaIdentity.cs b/generated/BotService/BotService.Autorest/generated/cmdlets/GetAzBotServiceCheckNameAvailability_GetViaJsonFilePath.cs similarity index 77% rename from generated/BotService/BotService.Autorest/generated/cmdlets/GetAzBotServiceQnAMakerEndpointKey_GetViaIdentity.cs rename to generated/BotService/BotService.Autorest/generated/cmdlets/GetAzBotServiceCheckNameAvailability_GetViaJsonFilePath.cs index eae650371016..f00b0990bf3d 100644 --- a/generated/BotService/BotService.Autorest/generated/cmdlets/GetAzBotServiceQnAMakerEndpointKey_GetViaIdentity.cs +++ b/generated/BotService/BotService.Autorest/generated/cmdlets/GetAzBotServiceCheckNameAvailability_GetViaJsonFilePath.cs @@ -6,20 +6,24 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Cmdlets; using System; - /// Lists the QnA Maker endpoint keys + /// Check whether a bot name is available. /// - /// [OpenAPI] Get=>POST:"/subscriptions/{subscriptionId}/providers/Microsoft.BotService/listQnAMakerEndpointKeys" + /// [OpenAPI] GetCheckNameAvailability=>POST:"/providers/Microsoft.BotService/checkNameAvailability" /// [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.InternalExport] - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzBotServiceQnAMakerEndpointKey_GetViaIdentity", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysResponse))] - [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Description(@"Lists the QnA Maker endpoint keys")] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzBotServiceCheckNameAvailability_GetViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityResponseBody))] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Description(@"Check whether a bot name is available.")] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.BotService/listQnAMakerEndpointKeys", ApiVersion = "2022-06-15-preview")] - public partial class GetAzBotServiceQnAMakerEndpointKey_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.HttpPath(Path = "/providers/Microsoft.BotService/checkNameAvailability", ApiVersion = "2022-06-15-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.NotSuggestDefaultParameterSet] + public partial class GetAzBotServiceCheckNameAvailability_GetViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +39,28 @@ public partial class GetAzBotServiceQnAMakerEndpointKey_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; + + 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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.BotService Client => Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.ClientAPI; @@ -53,6 +74,9 @@ public partial class GetAzBotServiceQnAMakerEndpointKey_GetViaIdentity : global: [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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 +89,22 @@ public partial class GetAzBotServiceQnAMakerEndpointKey_GetViaIdentity : global: [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Runtime)] public Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentity _inputObject; - - /// Identity Parameter - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] - [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Path)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentity 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 _jsonFilePath; + + /// Path of Json file supplied to the Get operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Get operation")] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Get 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. /// @@ -84,25 +113,10 @@ public partial class GetAzBotServiceQnAMakerEndpointKey_GetViaIdentity : global: /// cancellation token. global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysRequestBody _parameter; - - /// - /// The request body for a request to Bot Service Management to list QnA Maker endpoint keys. - /// - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The request body for a request to Bot Service Management to list QnA Maker endpoint keys.", ValueFromPipeline = true)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The request body for a request to Bot Service Management to list QnA Maker endpoint keys.", - SerializedName = @"parameters", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysRequestBody) })] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysRequestBody Parameter { get => this._parameter; set => this._parameter = value; } - /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.BotService.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,24 +139,24 @@ public partial class GetAzBotServiceQnAMakerEndpointKey_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.BotService.Models.Api20220615Preview.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IError /// 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.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityResponseBody /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -165,6 +179,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.BotService.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -186,9 +205,9 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// - public GetAzBotServiceQnAMakerEndpointKey_GetViaIdentity() + public GetAzBotServiceCheckNameAvailability_GetViaJsonFilePath() { } @@ -237,8 +256,33 @@ public GetAzBotServiceQnAMakerEndpointKey_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.BotService.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.BotService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -255,7 +299,7 @@ protected override void ProcessRecord() try { // work - if (ShouldProcess($"Call remote 'QnAMakerEndpointKeysGet' operation")) + if (ShouldProcess($"Call remote 'BotsGetCheckNameAvailability' operation")) { using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token) ) { @@ -294,7 +338,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -307,24 +351,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - if (InputObject?.Id != null) - { - await this.Client.QnAMakerEndpointKeysGetViaIdentity(InputObject.Id, Parameter, onOk, onDefault, this, Pipeline); - } - 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) ); - } - await this.Client.QnAMakerEndpointKeysGet(InputObject.SubscriptionId ?? null, Parameter, onOk, onDefault, this, Pipeline); - } + await this.Client.BotsGetCheckNameAvailabilityViaJsonString(_jsonString, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.BotService.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 { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -362,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.BotService.Models.Api20220615Preview.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IError /// 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 +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.BotService.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.BotService.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 } }); @@ -402,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.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityResponseBody /// 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,8 +451,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysResponse - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityResponseBody + 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/BotService/BotService.Autorest/generated/cmdlets/GetAzBotServiceQnAMakerEndpointKey_GetViaIdentityExpanded.cs b/generated/BotService/BotService.Autorest/generated/cmdlets/GetAzBotServiceCheckNameAvailability_GetViaJsonString.cs similarity index 78% rename from generated/BotService/BotService.Autorest/generated/cmdlets/GetAzBotServiceQnAMakerEndpointKey_GetViaIdentityExpanded.cs rename to generated/BotService/BotService.Autorest/generated/cmdlets/GetAzBotServiceCheckNameAvailability_GetViaJsonString.cs index fd3d7fa33012..dd3d3b0122d2 100644 --- a/generated/BotService/BotService.Autorest/generated/cmdlets/GetAzBotServiceQnAMakerEndpointKey_GetViaIdentityExpanded.cs +++ b/generated/BotService/BotService.Autorest/generated/cmdlets/GetAzBotServiceCheckNameAvailability_GetViaJsonString.cs @@ -6,20 +6,24 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Cmdlets; using System; - /// Lists the QnA Maker endpoint keys + /// Check whether a bot name is available. /// - /// [OpenAPI] Get=>POST:"/subscriptions/{subscriptionId}/providers/Microsoft.BotService/listQnAMakerEndpointKeys" + /// [OpenAPI] GetCheckNameAvailability=>POST:"/providers/Microsoft.BotService/checkNameAvailability" /// [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.InternalExport] - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzBotServiceQnAMakerEndpointKey_GetViaIdentityExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysResponse))] - [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Description(@"Lists the QnA Maker endpoint keys")] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzBotServiceCheckNameAvailability_GetViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityResponseBody))] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Description(@"Check whether a bot name is available.")] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.BotService/listQnAMakerEndpointKeys", ApiVersion = "2022-06-15-preview")] - public partial class GetAzBotServiceQnAMakerEndpointKey_GetViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.HttpPath(Path = "/providers/Microsoft.BotService/checkNameAvailability", ApiVersion = "2022-06-15-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.NotSuggestDefaultParameterSet] + public partial class GetAzBotServiceCheckNameAvailability_GetViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,27 +39,26 @@ public partial class GetAzBotServiceQnAMakerEndpointKey_GetViaIdentityExpanded : /// 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 request body for a request to Bot Service Management to list QnA Maker endpoint keys. + /// 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 Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysRequestBody _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.QnAMakerEndpointKeysRequestBody(); - - /// Subscription key which provides access to this API. - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Subscription key which provides access to this API.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Subscription key which provides access to this API.", - SerializedName = @"authkey", - PossibleTypes = new [] { typeof(string) })] - public string Authkey { get => _parametersBody.Authkey ?? null; set => _parametersBody.Authkey = value; } + 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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.BotService Client => Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.ClientAPI; @@ -69,16 +72,8 @@ public partial class GetAzBotServiceQnAMakerEndpointKey_GetViaIdentityExpanded : [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } - /// the host name of the QnA Maker endpoint - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "the host name of the QnA Maker endpoint")] - [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"the host name of the QnA Maker endpoint", - SerializedName = @"hostname", - PossibleTypes = new [] { typeof(string) })] - public string Hostname { get => _parametersBody.Hostname ?? null; set => _parametersBody.Hostname = 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")] @@ -92,17 +87,22 @@ public partial class GetAzBotServiceQnAMakerEndpointKey_GetViaIdentityExpanded : [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Runtime)] public Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentity _inputObject; - - /// Identity Parameter - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] - [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Path)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentity 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 Get operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Get operation")] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Get operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = value; } + /// /// cancellation delegate. Stops the cmdlet when called. /// @@ -114,7 +114,7 @@ public partial class GetAzBotServiceQnAMakerEndpointKey_GetViaIdentityExpanded : /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.BotService.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,24 +137,24 @@ public partial class GetAzBotServiceQnAMakerEndpointKey_GetViaIdentityExpanded : /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IError /// 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.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityResponseBody /// 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) @@ -177,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.BotService.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -198,9 +203,9 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// - public GetAzBotServiceQnAMakerEndpointKey_GetViaIdentityExpanded() + public GetAzBotServiceCheckNameAvailability_GetViaJsonString() { } @@ -249,8 +254,33 @@ public GetAzBotServiceQnAMakerEndpointKey_GetViaIdentityExpanded() 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.BotService.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.BotService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -267,7 +297,7 @@ protected override void ProcessRecord() try { // work - if (ShouldProcess($"Call remote 'QnAMakerEndpointKeysGet' operation")) + if (ShouldProcess($"Call remote 'BotsGetCheckNameAvailability' operation")) { using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token) ) { @@ -306,7 +336,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -319,24 +349,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - if (InputObject?.Id != null) - { - await this.Client.QnAMakerEndpointKeysGetViaIdentity(InputObject.Id, _parametersBody, onOk, onDefault, this, Pipeline); - } - 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) ); - } - await this.Client.QnAMakerEndpointKeysGet(InputObject.SubscriptionId ?? null, _parametersBody, onOk, onDefault, this, Pipeline); - } + await this.Client.BotsGetCheckNameAvailabilityViaJsonString(_jsonString, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.BotService.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,12 +392,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.BotService.Models.Api20220615Preview.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IError /// 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 +414,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.BotService.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.BotService.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 } }); @@ -414,12 +432,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.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityResponseBody /// 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 +449,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysResponse - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityResponseBody + 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/BotService/BotService.Autorest/generated/cmdlets/GetAzBotServiceHostSetting_Get.cs b/generated/BotService/BotService.Autorest/generated/cmdlets/GetAzBotServiceHostSetting_Get.cs index 3f9797a16e30..ee56ebfb0282 100644 --- a/generated/BotService/BotService.Autorest/generated/cmdlets/GetAzBotServiceHostSetting_Get.cs +++ b/generated/BotService/BotService.Autorest/generated/cmdlets/GetAzBotServiceHostSetting_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Cmdlets; using System; /// @@ -15,12 +17,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.BotService/hostSettings" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzBotServiceHostSetting_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IHostSettingsResponse))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IHostSettingsResponse))] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Description(@"Get per subscription settings needed to host bot in compute resource such as Azure App Service")] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.BotService/hostSettings", ApiVersion = "2022-06-15-preview")] public partial class GetAzBotServiceHostSetting_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -36,11 +39,26 @@ public partial class GetAzBotServiceHostSetting_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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.BotService Client => Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.ClientAPI; @@ -54,6 +72,9 @@ public partial class GetAzBotServiceHostSetting_Get : global::System.Management. [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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] @@ -80,7 +101,7 @@ public partial class GetAzBotServiceHostSetting_Get : global::System.Management. /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.BotService.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")] @@ -112,7 +133,8 @@ public partial class GetAzBotServiceHostSetting_Get : global::System.Management. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -121,24 +143,24 @@ public partial class GetAzBotServiceHostSetting_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.BotService.Models.Api20220615Preview.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IError /// 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.BotService.Models.Api20220615Preview.IHostSettingsResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IHostSettingsResponse /// 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 +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.BotService.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -182,7 +209,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzBotServiceHostSetting_Get() { @@ -233,8 +260,33 @@ public GetAzBotServiceHostSetting_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.BotService.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.BotService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -287,7 +339,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -308,7 +360,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.BotService.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 } }); @@ -346,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.BotService.Models.Api20220615Preview.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IError /// 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 ) { @@ -368,15 +420,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.BotService.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.BotService.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 } }); @@ -386,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.BotService.Models.Api20220615Preview.IHostSettingsResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IHostSettingsResponse /// 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 ) { @@ -403,8 +455,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IHostSettingsResponse - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IHostSettingsResponse + 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/BotService/BotService.Autorest/generated/cmdlets/GetAzBotServiceHostSetting_GetViaIdentity.cs b/generated/BotService/BotService.Autorest/generated/cmdlets/GetAzBotServiceHostSetting_GetViaIdentity.cs deleted file mode 100644 index 3e4ed11d567e..000000000000 --- a/generated/BotService/BotService.Autorest/generated/cmdlets/GetAzBotServiceHostSetting_GetViaIdentity.cs +++ /dev/null @@ -1,411 +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.BotService.Cmdlets -{ - using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; - using System; - - /// - /// Get per subscription settings needed to host bot in compute resource such as Azure App Service - /// - /// - /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.BotService/hostSettings" - /// - [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.InternalExport] - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzBotServiceHostSetting_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IHostSettingsResponse))] - [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Description(@"Get per subscription settings needed to host bot in compute resource such as Azure App Service")] - [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.BotService/hostSettings", ApiVersion = "2022-06-15-preview")] - public partial class GetAzBotServiceHostSetting_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener - { - /// 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(); - - /// 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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter Break { get; set; } - - /// The reference to the client API class. - public Microsoft.Azure.PowerShell.Cmdlets.BotService.BotService Client => Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Azure)] - public global::System.Management.Automation.PSObject DefaultProfile { get; set; } - - /// 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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentity _inputObject; - - /// Identity Parameter - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] - [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Path)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentity 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.BotService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - - /// cancellation token. - global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; - - /// - /// The instance of the that the remote call will use. - /// - private Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } - - /// - /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what - /// happens on that response. Implement this method in a partial class to enable this behavior - /// - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IError - /// 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.BotService.Models.Api20220615Preview.IHostSettingsResponse - /// 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.BotService.Module.Instance.GetTelemetryId.Invoke(); - if (telemetryId != "" && telemetryId != "internal") - { - __correlationId = telemetryId; - } - Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); - if (Break) - { - Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.AttachDebugger.Break(); - } - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - - /// Performs clean-up after the command execution - protected override void EndProcessing() - { - var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.BotService.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"); - } - } - } - } - - /// - /// Intializes a new instance of the cmdlet class. - /// - public GetAzBotServiceHostSetting_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 - /// 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.BotService.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.BotService.Runtime.Events.Verbose: - { - WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Warning: - { - WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Information: - { - var data = messageData(); - WriteInformation(data.Message, new string[]{}); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Debug: - { - WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.BotService.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 ; - } - } - await Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - __processRecordId = System.Guid.NewGuid().ToString(); - try - { - // work - using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token) ) - { - asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); - if (null != HttpPipelinePrepend) - { - Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); - } - if (null != HttpPipelineAppend) - { - Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); - } - // get the client instance - try - { - await ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - if (InputObject?.Id != null) - { - await this.Client.HostSettingsGetViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); - } - 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) ); - } - await this.Client.HostSettingsGet(InputObject.SubscriptionId ?? null, onOk, onDefault, this, Pipeline); - } - await ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - catch (Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletProcessRecordAsyncEnd); - } - } - } - - /// Interrupts currently running code within the command. - protected override void StopProcessing() - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Cancel(); - base.StopProcessing(); - } - - /// - new protected void WriteObject(object sendToPipeline) - { - Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline); - } - - /// - /// - new protected void WriteObject(object sendToPipeline, bool enumerateCollection) - { - Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IError - /// 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.BotService.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.BotService.Models.Api20220615Preview.IHostSettingsResponse - /// 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.BotService.Models.Api20220615Preview.IHostSettingsResponse - WriteObject((await response)); - } - } - } -} \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/cmdlets/GetAzBotServiceOperation_List.cs b/generated/BotService/BotService.Autorest/generated/cmdlets/GetAzBotServiceOperation_List.cs index 7f3196273bb7..b52123c0722f 100644 --- a/generated/BotService/BotService.Autorest/generated/cmdlets/GetAzBotServiceOperation_List.cs +++ b/generated/BotService/BotService.Autorest/generated/cmdlets/GetAzBotServiceOperation_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Cmdlets; using System; /// Lists all the available BotService operations. @@ -14,12 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzBotServiceOperation_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntity))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntity))] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Description(@"Lists all the available BotService operations.")] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.HttpPath(Path = "/providers/Microsoft.BotService/operations", ApiVersion = "2022-06-15-preview")] public partial class GetAzBotServiceOperation_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.BotService.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 GetAzBotServiceOperation_List : 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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.BotService Client => Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.ClientAPI; @@ -59,6 +77,9 @@ public partial class GetAzBotServiceOperation_List : global::System.Management.A [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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 GetAzBotServiceOperation_List : global::System.Management.A /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.BotService.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")] @@ -108,24 +129,24 @@ public partial class GetAzBotServiceOperation_List : 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.BotService.Models.Api20220615Preview.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IError /// 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.BotService.Models.Api20220615Preview.IOperationEntityListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntityListResult /// 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) @@ -148,6 +169,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.BotService.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -169,7 +195,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzBotServiceOperation_List() { @@ -220,8 +246,33 @@ public GetAzBotServiceOperation_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.BotService.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.BotService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -274,7 +325,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -292,7 +343,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.BotService.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 } }); @@ -330,12 +381,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.BotService.Models.Api20220615Preview.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IError /// 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 ) { @@ -352,7 +403,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.BotService.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.BotService.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 } @@ -370,12 +421,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.BotService.Models.Api20220615Preview.IOperationEntityListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntityListResult /// 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 ) { @@ -387,15 +438,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntityListResult + 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/BotService/BotService.Autorest/generated/cmdlets/GetAzBotServicePrivateEndpointConnection_GetViaIdentity.cs b/generated/BotService/BotService.Autorest/generated/cmdlets/GetAzBotServicePrivateEndpointConnection_GetViaIdentity.cs deleted file mode 100644 index 16a07e558aa6..000000000000 --- a/generated/BotService/BotService.Autorest/generated/cmdlets/GetAzBotServicePrivateEndpointConnection_GetViaIdentity.cs +++ /dev/null @@ -1,421 +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.BotService.Cmdlets -{ - using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; - using System; - - /// Gets the specified private endpoint connection associated with the Bot. - /// - /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}" - /// - [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.InternalExport] - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzBotServicePrivateEndpointConnection_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnection))] - [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Description(@"Gets the specified private endpoint connection associated with the Bot.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", ApiVersion = "2022-06-15-preview")] - public partial class GetAzBotServicePrivateEndpointConnection_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener - { - /// 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(); - - /// 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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter Break { get; set; } - - /// The reference to the client API class. - public Microsoft.Azure.PowerShell.Cmdlets.BotService.BotService Client => Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Azure)] - public global::System.Management.Automation.PSObject DefaultProfile { get; set; } - - /// 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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentity _inputObject; - - /// Identity Parameter - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] - [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Path)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentity 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.BotService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - - /// cancellation token. - global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; - - /// - /// The instance of the that the remote call will use. - /// - private Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } - - /// - /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what - /// happens on that response. Implement this method in a partial class to enable this behavior - /// - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IError - /// 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.BotService.Models.Api20220615Preview.IPrivateEndpointConnection - /// 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.BotService.Module.Instance.GetTelemetryId.Invoke(); - if (telemetryId != "" && telemetryId != "internal") - { - __correlationId = telemetryId; - } - Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); - if (Break) - { - Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.AttachDebugger.Break(); - } - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - - /// Performs clean-up after the command execution - protected override void EndProcessing() - { - var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.BotService.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"); - } - } - } - } - - /// - /// Intializes a new instance of the cmdlet class. - /// - public GetAzBotServicePrivateEndpointConnection_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 - /// 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.BotService.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.BotService.Runtime.Events.Verbose: - { - WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Warning: - { - WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Information: - { - var data = messageData(); - WriteInformation(data.Message, new string[]{}); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Debug: - { - WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.BotService.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 ; - } - } - await Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - __processRecordId = System.Guid.NewGuid().ToString(); - try - { - // work - using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token) ) - { - asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); - if (null != HttpPipelinePrepend) - { - Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); - } - if (null != HttpPipelineAppend) - { - Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); - } - // get the client instance - try - { - await ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - if (InputObject?.Id != null) - { - await this.Client.PrivateEndpointConnectionsGetViaIdentity(InputObject.Id, onOk, 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.ResourceName) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceName"),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) ); - } - if (null == InputObject.PrivateEndpointConnectionName) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PrivateEndpointConnectionName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); - } - await this.Client.PrivateEndpointConnectionsGet(InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, InputObject.SubscriptionId ?? null, InputObject.PrivateEndpointConnectionName ?? null, onOk, onDefault, this, Pipeline); - } - await ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - catch (Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletProcessRecordAsyncEnd); - } - } - } - - /// Interrupts currently running code within the command. - protected override void StopProcessing() - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Cancel(); - base.StopProcessing(); - } - - /// - new protected void WriteObject(object sendToPipeline) - { - Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline); - } - - /// - /// - new protected void WriteObject(object sendToPipeline, bool enumerateCollection) - { - Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IError - /// 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.BotService.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.BotService.Models.Api20220615Preview.IPrivateEndpointConnection - /// 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.BotService.Models.Api20220615Preview.IPrivateEndpointConnection - WriteObject((await response)); - } - } - } -} \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/cmdlets/GetAzBotServicePrivateEndpointConnection_List.cs b/generated/BotService/BotService.Autorest/generated/cmdlets/GetAzBotServicePrivateEndpointConnection_List.cs deleted file mode 100644 index 607da821a246..000000000000 --- a/generated/BotService/BotService.Autorest/generated/cmdlets/GetAzBotServicePrivateEndpointConnection_List.cs +++ /dev/null @@ -1,439 +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.BotService.Cmdlets -{ - using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; - using System; - - /// List all the private endpoint connections associated with the Bot. - /// - /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/privateEndpointConnections" - /// - [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.InternalExport] - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzBotServicePrivateEndpointConnection_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnection))] - [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Description(@"List all the private endpoint connections associated with the Bot.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/privateEndpointConnections", ApiVersion = "2022-06-15-preview")] - public partial class GetAzBotServicePrivateEndpointConnection_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener - { - /// 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(); - - /// 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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter Break { get; set; } - - /// The reference to the client API class. - public Microsoft.Azure.PowerShell.Cmdlets.BotService.BotService Client => Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Azure)] - public global::System.Management.Automation.PSObject DefaultProfile { get; set; } - - /// 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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - - /// cancellation token. - global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; - - /// - /// The instance of the that the remote call will use. - /// - private Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } - - /// Backing field for property. - private string _resourceGroupName; - - /// The name of the Bot resource group in the user subscription. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Bot resource group in the user subscription.")] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the Bot resource group in the user subscription.", - SerializedName = @"resourceGroupName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Path)] - public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } - - /// Backing field for property. - private string _resourceName; - - /// The name of the Bot resource. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Bot resource.")] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the Bot resource.", - SerializedName = @"resourceName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Path)] - public string ResourceName { get => this._resourceName; set => this._resourceName = value; } - - /// Backing field for property. - private string[] _subscriptionId; - - /// Azure Subscription ID. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Azure Subscription ID.")] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"Azure Subscription ID.", - SerializedName = @"subscriptionId", - PossibleTypes = new [] { typeof(string) })] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.DefaultInfo( - Name = @"", - Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] - [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IError - /// 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.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionListResult - /// 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.BotService.Module.Instance.GetTelemetryId.Invoke(); - if (telemetryId != "" && telemetryId != "internal") - { - __correlationId = telemetryId; - } - Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); - if (Break) - { - Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.AttachDebugger.Break(); - } - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - - /// Performs clean-up after the command execution - protected override void EndProcessing() - { - var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.BotService.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"); - } - } - } - } - - /// - /// Intializes a new instance of the cmdlet class. - /// - public GetAzBotServicePrivateEndpointConnection_List() - { - - } - - /// 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.BotService.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.BotService.Runtime.Events.Verbose: - { - WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Warning: - { - WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Information: - { - var data = messageData(); - WriteInformation(data.Message, new string[]{}); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Debug: - { - WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.BotService.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 ; - } - } - await Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - __processRecordId = System.Guid.NewGuid().ToString(); - try - { - // work - using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token) ) - { - asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); - if (null != HttpPipelinePrepend) - { - Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); - } - if (null != HttpPipelineAppend) - { - Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); - } - // get the client instance - try - { - foreach( var SubscriptionId in this.SubscriptionId ) - { - await ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.PrivateEndpointConnectionsList(ResourceGroupName, ResourceName, SubscriptionId, onOk, onDefault, this, Pipeline); - await ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - } - catch (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.UndeclaredResponseException urexception) - { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,ResourceName=ResourceName,SubscriptionId=SubscriptionId}) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } - }); - } - finally - { - await ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletProcessRecordAsyncEnd); - } - } - } - - /// Interrupts currently running code within the command. - protected override void StopProcessing() - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Cancel(); - base.StopProcessing(); - } - - /// - new protected void WriteObject(object sendToPipeline) - { - Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline); - } - - /// - /// - new protected void WriteObject(object sendToPipeline, bool enumerateCollection) - { - Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IError - /// 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.BotService.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, ResourceName=ResourceName, SubscriptionId=SubscriptionId }) - { - 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, ResourceName=ResourceName, SubscriptionId=SubscriptionId }) - { - 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.BotService.Models.Api20220615Preview.IPrivateEndpointConnectionListResult - /// 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 - // response should be returning an array of some kind. +Pageable - // pageable / value / - WriteObject((await response).Value, true); - } - } - } -} \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/cmdlets/GetAzBotServiceQnAMakerEndpointKey_Get.cs b/generated/BotService/BotService.Autorest/generated/cmdlets/GetAzBotServiceQnAMakerEndpointKey_Get.cs index 432b5b54567b..0675ba4c0186 100644 --- a/generated/BotService/BotService.Autorest/generated/cmdlets/GetAzBotServiceQnAMakerEndpointKey_Get.cs +++ b/generated/BotService/BotService.Autorest/generated/cmdlets/GetAzBotServiceQnAMakerEndpointKey_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Cmdlets; using System; /// Lists the QnA Maker endpoint keys @@ -14,12 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzBotServiceQnAMakerEndpointKey_Get", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysResponse))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysResponse))] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Description(@"Lists the QnA Maker endpoint keys")] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.BotService/listQnAMakerEndpointKeys", ApiVersion = "2022-06-15-preview")] public partial class GetAzBotServiceQnAMakerEndpointKey_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.BotService.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 GetAzBotServiceQnAMakerEndpointKey_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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.BotService Client => Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.ClientAPI; @@ -53,6 +71,9 @@ public partial class GetAzBotServiceQnAMakerEndpointKey_Get : global::System.Man [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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] @@ -77,7 +98,7 @@ public partial class GetAzBotServiceQnAMakerEndpointKey_Get : global::System.Man global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysRequestBody _parameter; + private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysRequestBody _parameter; /// /// The request body for a request to Bot Service Management to list QnA Maker endpoint keys. @@ -88,13 +109,14 @@ public partial class GetAzBotServiceQnAMakerEndpointKey_Get : global::System.Man ReadOnly = false, Description = @"The request body for a request to Bot Service Management to list QnA Maker endpoint keys.", SerializedName = @"parameters", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysRequestBody) })] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysRequestBody Parameter { get => this._parameter; set => this._parameter = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysRequestBody) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Body)] + public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysRequestBody Parameter { get => this._parameter; set => this._parameter = value; } /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.BotService.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")] @@ -126,7 +148,8 @@ public partial class GetAzBotServiceQnAMakerEndpointKey_Get : global::System.Man [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -135,24 +158,24 @@ public partial class GetAzBotServiceQnAMakerEndpointKey_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.BotService.Models.Api20220615Preview.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IError /// 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.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysResponse /// 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 +198,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.BotService.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -196,7 +224,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzBotServiceQnAMakerEndpointKey_Get() { @@ -247,8 +275,33 @@ public GetAzBotServiceQnAMakerEndpointKey_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.BotService.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.BotService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -304,7 +357,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -325,7 +378,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,body=Parameter}) + 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 } }); @@ -363,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.BotService.Models.Api20220615Preview.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IError /// 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 +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.BotService.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, body=Parameter }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, body=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 } }); @@ -403,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.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysResponse /// 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,8 +473,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysResponse - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysResponse + 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/BotService/BotService.Autorest/generated/cmdlets/GetAzBotServiceQnAMakerEndpointKey_GetExpanded.cs b/generated/BotService/BotService.Autorest/generated/cmdlets/GetAzBotServiceQnAMakerEndpointKey_GetExpanded.cs index bc21ce440626..d73f2e826e5e 100644 --- a/generated/BotService/BotService.Autorest/generated/cmdlets/GetAzBotServiceQnAMakerEndpointKey_GetExpanded.cs +++ b/generated/BotService/BotService.Autorest/generated/cmdlets/GetAzBotServiceQnAMakerEndpointKey_GetExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Cmdlets; using System; /// Lists the QnA Maker endpoint keys @@ -14,12 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzBotServiceQnAMakerEndpointKey_GetExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysResponse))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysResponse))] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Description(@"Lists the QnA Maker endpoint keys")] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.BotService/listQnAMakerEndpointKeys", ApiVersion = "2022-06-15-preview")] public partial class GetAzBotServiceQnAMakerEndpointKey_GetExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,10 +38,22 @@ public partial class GetAzBotServiceQnAMakerEndpointKey_GetExpanded : 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; + /// /// The request body for a request to Bot Service Management to list QnA Maker endpoint keys. /// - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysRequestBody _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.QnAMakerEndpointKeysRequestBody(); + private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysRequestBody _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.QnAMakerEndpointKeysRequestBody(); + + /// + /// 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; /// Subscription key which provides access to this API. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Subscription key which provides access to this API.")] @@ -56,6 +71,9 @@ public partial class GetAzBotServiceQnAMakerEndpointKey_GetExpanded : global::Sy [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.BotService Client => Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.ClientAPI; @@ -69,6 +87,9 @@ public partial class GetAzBotServiceQnAMakerEndpointKey_GetExpanded : global::Sy [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// the host name of the QnA Maker endpoint [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "the host name of the QnA Maker endpoint")] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Body)] @@ -106,7 +127,7 @@ public partial class GetAzBotServiceQnAMakerEndpointKey_GetExpanded : global::Sy /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -138,7 +159,8 @@ public partial class GetAzBotServiceQnAMakerEndpointKey_GetExpanded : global::Sy [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -147,24 +169,24 @@ public partial class GetAzBotServiceQnAMakerEndpointKey_GetExpanded : 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.BotService.Models.Api20220615Preview.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IError /// 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.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysResponse /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -187,6 +209,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -208,7 +235,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzBotServiceQnAMakerEndpointKey_GetExpanded() { @@ -259,8 +286,33 @@ public GetAzBotServiceQnAMakerEndpointKey_GetExpanded() 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.BotService.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.BotService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -316,7 +368,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -337,7 +389,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,body=_parametersBody}) + 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 } }); @@ -375,12 +427,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IError /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -397,15 +449,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, body=_parametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, body=_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 } }); @@ -415,12 +467,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -432,8 +484,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysResponse - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysResponse + 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/BotService/BotService.Autorest/generated/cmdlets/GetAzBotServicePrivateLinkResource_List.cs b/generated/BotService/BotService.Autorest/generated/cmdlets/GetAzBotServiceQnAMakerEndpointKey_GetViaJsonFilePath.cs similarity index 76% rename from generated/BotService/BotService.Autorest/generated/cmdlets/GetAzBotServicePrivateLinkResource_List.cs rename to generated/BotService/BotService.Autorest/generated/cmdlets/GetAzBotServiceQnAMakerEndpointKey_GetViaJsonFilePath.cs index 0ea05970beb8..7d617f9eec75 100644 --- a/generated/BotService/BotService.Autorest/generated/cmdlets/GetAzBotServicePrivateLinkResource_List.cs +++ b/generated/BotService/BotService.Autorest/generated/cmdlets/GetAzBotServiceQnAMakerEndpointKey_GetViaJsonFilePath.cs @@ -6,20 +6,24 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Cmdlets; using System; - /// Gets the private link resources that need to be created for a Bot. + /// Lists the QnA Maker endpoint keys /// - /// [OpenAPI] ListByBotResource=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/privateLinkResources" + /// [OpenAPI] Get=>POST:"/subscriptions/{subscriptionId}/providers/Microsoft.BotService/listQnAMakerEndpointKeys" /// [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.InternalExport] - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzBotServicePrivateLinkResource_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResource))] - [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Description(@"Gets the private link resources that need to be created for a Bot.")] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzBotServiceQnAMakerEndpointKey_GetViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Description(@"Lists the QnA Maker endpoint keys")] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/privateLinkResources", ApiVersion = "2022-06-15-preview")] - public partial class GetAzBotServicePrivateLinkResource_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.BotService/listQnAMakerEndpointKeys", ApiVersion = "2022-06-15-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.NotSuggestDefaultParameterSet] + public partial class GetAzBotServiceQnAMakerEndpointKey_GetViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +39,28 @@ public partial class GetAzBotServicePrivateLinkResource_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; + + 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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.BotService Client => Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.ClientAPI; @@ -53,6 +74,9 @@ public partial class GetAzBotServicePrivateLinkResource_List : global::System.Ma [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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] @@ -68,6 +92,19 @@ public partial class GetAzBotServicePrivateLinkResource_List : global::System.Ma /// 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 Get operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Get operation")] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Get 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. /// @@ -79,7 +116,7 @@ public partial class GetAzBotServicePrivateLinkResource_List : global::System.Ma /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.BotService.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")] @@ -97,34 +134,6 @@ public partial class GetAzBotServicePrivateLinkResource_List : global::System.Ma [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } - /// Backing field for property. - private string _resourceGroupName; - - /// The name of the Bot resource group in the user subscription. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Bot resource group in the user subscription.")] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the Bot resource group in the user subscription.", - SerializedName = @"resourceGroupName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Path)] - public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } - - /// Backing field for property. - private string _resourceName; - - /// The name of the Bot resource. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Bot resource.")] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the Bot resource.", - SerializedName = @"resourceName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Path)] - public string ResourceName { get => this._resourceName; set => this._resourceName = value; } - /// Backing field for property. private string[] _subscriptionId; @@ -139,7 +148,8 @@ public partial class GetAzBotServicePrivateLinkResource_List : global::System.Ma [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -148,24 +158,24 @@ public partial class GetAzBotServicePrivateLinkResource_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.BotService.Models.Api20220615Preview.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IError /// 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.BotService.Models.Api20220615Preview.IPrivateLinkResourceListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysResponse /// 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 +198,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.BotService.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -209,9 +224,9 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// - public GetAzBotServicePrivateLinkResource_List() + public GetAzBotServiceQnAMakerEndpointKey_GetViaJsonFilePath() { } @@ -260,8 +275,33 @@ public GetAzBotServicePrivateLinkResource_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.BotService.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.BotService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -278,9 +318,12 @@ protected override void ProcessRecord() try { // work - using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token) ) + if (ShouldProcess($"Call remote 'QnAMakerEndpointKeysGet' operation")) { - asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token); + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token); + } } } catch (global::System.AggregateException aggregateException) @@ -314,7 +357,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -329,13 +372,13 @@ protected override void ProcessRecord() foreach( var SubscriptionId in this.SubscriptionId ) { await ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.PrivateLinkResourcesListByBotResource(ResourceGroupName, ResourceName, SubscriptionId, onOk, onDefault, this, Pipeline); + await this.Client.QnAMakerEndpointKeysGetViaJsonString(SubscriptionId, _jsonString, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } } catch (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,ResourceName=ResourceName,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 } }); @@ -373,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.BotService.Models.Api20220615Preview.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IError /// 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 +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.BotService.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, ResourceName=ResourceName, SubscriptionId=SubscriptionId }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.BotService.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, ResourceName=ResourceName, 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 } }); @@ -413,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.BotService.Models.Api20220615Preview.IPrivateLinkResourceListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysResponse /// 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,9 +473,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // response should be returning an array of some kind. +Pageable - // nested-array / value / - WriteObject((await response).Value, true); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysResponse + 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/BotService/BotService.Autorest/generated/cmdlets/GetAzBotServicePrivateEndpointConnection_Get.cs b/generated/BotService/BotService.Autorest/generated/cmdlets/GetAzBotServiceQnAMakerEndpointKey_GetViaJsonString.cs similarity index 77% rename from generated/BotService/BotService.Autorest/generated/cmdlets/GetAzBotServicePrivateEndpointConnection_Get.cs rename to generated/BotService/BotService.Autorest/generated/cmdlets/GetAzBotServiceQnAMakerEndpointKey_GetViaJsonString.cs index e994d03cc3e6..7b306a5d1451 100644 --- a/generated/BotService/BotService.Autorest/generated/cmdlets/GetAzBotServicePrivateEndpointConnection_Get.cs +++ b/generated/BotService/BotService.Autorest/generated/cmdlets/GetAzBotServiceQnAMakerEndpointKey_GetViaJsonString.cs @@ -6,20 +6,24 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Cmdlets; using System; - /// Gets the specified private endpoint connection associated with the Bot. + /// Lists the QnA Maker endpoint keys /// - /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}" + /// [OpenAPI] Get=>POST:"/subscriptions/{subscriptionId}/providers/Microsoft.BotService/listQnAMakerEndpointKeys" /// [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.InternalExport] - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzBotServicePrivateEndpointConnection_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnection))] - [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Description(@"Gets the specified private endpoint connection associated with the Bot.")] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzBotServiceQnAMakerEndpointKey_GetViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Description(@"Lists the QnA Maker endpoint keys")] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", ApiVersion = "2022-06-15-preview")] - public partial class GetAzBotServicePrivateEndpointConnection_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.BotService/listQnAMakerEndpointKeys", ApiVersion = "2022-06-15-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.NotSuggestDefaultParameterSet] + public partial class GetAzBotServiceQnAMakerEndpointKey_GetViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +39,26 @@ public partial class GetAzBotServicePrivateEndpointConnection_Get : 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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.BotService Client => Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.ClientAPI; @@ -53,6 +72,9 @@ public partial class GetAzBotServicePrivateEndpointConnection_Get : global::Syst [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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] @@ -68,6 +90,19 @@ public partial class GetAzBotServicePrivateEndpointConnection_Get : global::Syst /// 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 Get operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Get operation")] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Get operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = value; } + /// /// cancellation delegate. Stops the cmdlet when called. /// @@ -76,25 +111,10 @@ public partial class GetAzBotServicePrivateEndpointConnection_Get : global::Syst /// cancellation token. global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; - /// Backing field for property. - private string _name; - - /// The name of the private endpoint connection associated with the Azure resource - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the private endpoint connection associated with the Azure resource")] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the private endpoint connection associated with the Azure resource", - SerializedName = @"privateEndpointConnectionName", - PossibleTypes = new [] { typeof(string) })] - [global::System.Management.Automation.Alias("PrivateEndpointConnectionName")] - [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.BotService.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")] @@ -112,34 +132,6 @@ public partial class GetAzBotServicePrivateEndpointConnection_Get : global::Syst [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } - /// Backing field for property. - private string _resourceGroupName; - - /// The name of the Bot resource group in the user subscription. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Bot resource group in the user subscription.")] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the Bot resource group in the user subscription.", - SerializedName = @"resourceGroupName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Path)] - public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } - - /// Backing field for property. - private string _resourceName; - - /// The name of the Bot resource. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Bot resource.")] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the Bot resource.", - SerializedName = @"resourceName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Path)] - public string ResourceName { get => this._resourceName; set => this._resourceName = value; } - /// Backing field for property. private string[] _subscriptionId; @@ -154,7 +146,8 @@ public partial class GetAzBotServicePrivateEndpointConnection_Get : global::Syst [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -163,24 +156,24 @@ public partial class GetAzBotServicePrivateEndpointConnection_Get : 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.BotService.Models.Api20220615Preview.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IError /// 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.BotService.Models.Api20220615Preview.IPrivateEndpointConnection + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysResponse /// 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) @@ -203,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.BotService.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -224,9 +222,9 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// - public GetAzBotServicePrivateEndpointConnection_Get() + public GetAzBotServiceQnAMakerEndpointKey_GetViaJsonString() { } @@ -275,8 +273,33 @@ public GetAzBotServicePrivateEndpointConnection_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.BotService.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.BotService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -293,9 +316,12 @@ protected override void ProcessRecord() try { // work - using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token) ) + if (ShouldProcess($"Call remote 'QnAMakerEndpointKeysGet' operation")) { - asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token); + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token); + } } } catch (global::System.AggregateException aggregateException) @@ -329,7 +355,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -344,13 +370,13 @@ protected override void ProcessRecord() foreach( var SubscriptionId in this.SubscriptionId ) { await ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.PrivateEndpointConnectionsGet(ResourceGroupName, ResourceName, SubscriptionId, Name, onOk, onDefault, this, Pipeline); + await this.Client.QnAMakerEndpointKeysGetViaJsonString(SubscriptionId, _jsonString, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } } catch (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,ResourceName=ResourceName,SubscriptionId=SubscriptionId,Name=Name}) + 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 } }); @@ -388,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.BotService.Models.Api20220615Preview.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IError /// 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 +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.BotService.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, ResourceName=ResourceName, SubscriptionId=SubscriptionId, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.BotService.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, ResourceName=ResourceName, 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,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.BotService.Models.Api20220615Preview.IPrivateEndpointConnection + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysResponse /// 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 +471,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnection - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysResponse + 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/BotService/BotService.Autorest/generated/cmdlets/GetAzBotService_Get.cs b/generated/BotService/BotService.Autorest/generated/cmdlets/GetAzBotService_Get.cs index 5e0e33f4eaec..c242df2f3adf 100644 --- a/generated/BotService/BotService.Autorest/generated/cmdlets/GetAzBotService_Get.cs +++ b/generated/BotService/BotService.Autorest/generated/cmdlets/GetAzBotService_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Cmdlets; using System; /// Returns a BotService specified by the parameters. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzBotService_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot))] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Description(@"Returns a BotService specified by the parameters.")] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}", ApiVersion = "2022-06-15-preview")] public partial class GetAzBotService_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.BotService.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 GetAzBotService_Get : global::System.Management.Automation. /// 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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.BotService Client => Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class GetAzBotService_Get : global::System.Management.Automation. [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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 GetAzBotService_Get : global::System.Management.Automation. /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -139,7 +160,8 @@ public partial class GetAzBotService_Get : global::System.Management.Automation. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -148,24 +170,24 @@ public partial class GetAzBotService_Get : global::System.Management.Automation. /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IError /// 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.BotService.Models.Api20220615Preview.IBot + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -188,6 +210,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -209,7 +236,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzBotService_Get() { @@ -260,8 +287,33 @@ public GetAzBotService_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.BotService.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.BotService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -314,7 +366,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -329,13 +381,13 @@ protected override void ProcessRecord() foreach( var SubscriptionId in this.SubscriptionId ) { await ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.BotsGet(ResourceGroupName, Name, SubscriptionId, onOk, onDefault, this, Pipeline); + await this.Client.BotsGet(SubscriptionId, ResourceGroupName, Name, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } } catch (Microsoft.Azure.PowerShell.Cmdlets.BotService.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 } }); @@ -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.BotService.Models.Api20220615Preview.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IError /// 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.BotService.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.BotService.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 } }); @@ -413,12 +465,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -430,8 +482,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot + 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/BotService/BotService.Autorest/generated/cmdlets/GetAzBotService_GetViaIdentity.cs b/generated/BotService/BotService.Autorest/generated/cmdlets/GetAzBotService_GetViaIdentity.cs index 4058d6e26f45..1228048e1869 100644 --- a/generated/BotService/BotService.Autorest/generated/cmdlets/GetAzBotService_GetViaIdentity.cs +++ b/generated/BotService/BotService.Autorest/generated/cmdlets/GetAzBotService_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Cmdlets; using System; /// Returns a BotService specified by the parameters. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzBotService_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot))] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Description(@"Returns a BotService specified by the parameters.")] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}", ApiVersion = "2022-06-15-preview")] public partial class GetAzBotService_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.BotService.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 GetAzBotService_GetViaIdentity : 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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.BotService Client => Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class GetAzBotService_GetViaIdentity : global::System.Management. [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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 GetAzBotService_GetViaIdentity : global::System.Management. /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.BotService.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 GetAzBotService_GetViaIdentity : 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.BotService.Models.Api20220615Preview.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IError /// 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.BotService.Models.Api20220615Preview.IBot + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot /// 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.BotService.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 GetAzBotService_GetViaIdentity() { @@ -221,8 +247,33 @@ public GetAzBotService_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.BotService.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.BotService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -295,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) ); @@ -303,17 +358,13 @@ protected override void ProcessRecord() { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceName"),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.BotsGet(InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, InputObject.SubscriptionId ?? null, onOk, onDefault, this, Pipeline); + await this.Client.BotsGet(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, onOk, onDefault, this, Pipeline); } await ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -351,12 +402,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IError /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -373,7 +424,7 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.RestException(responseMessage, await response); WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } @@ -391,12 +442,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -408,8 +459,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot + 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/BotService/BotService.Autorest/generated/cmdlets/GetAzBotService_List.cs b/generated/BotService/BotService.Autorest/generated/cmdlets/GetAzBotService_List.cs index 04a698c06622..2d27832cf608 100644 --- a/generated/BotService/BotService.Autorest/generated/cmdlets/GetAzBotService_List.cs +++ b/generated/BotService/BotService.Autorest/generated/cmdlets/GetAzBotService_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Cmdlets; using System; /// Returns all the resources of a particular type belonging to a resource group @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Cmdlets /// [OpenAPI] ListByResourceGroup=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzBotService_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot))] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Description(@"Returns all the resources of a particular type belonging to a resource group")] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices", ApiVersion = "2022-06-15-preview")] public partial class GetAzBotService_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.BotService.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 GetAzBotService_List : global::System.Management.Automation /// 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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.BotService Client => Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.ClientAPI; @@ -58,6 +76,9 @@ public partial class GetAzBotService_List : global::System.Management.Automation [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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 GetAzBotService_List : global::System.Management.Automation /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -130,7 +151,8 @@ public partial class GetAzBotService_List : global::System.Management.Automation [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -139,24 +161,24 @@ public partial class GetAzBotService_List : global::System.Management.Automation /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IError /// 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.BotService.Models.Api20220615Preview.IBotResponseList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotResponseList /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -179,6 +201,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -200,7 +227,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzBotService_List() { @@ -251,8 +278,33 @@ public GetAzBotService_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.BotService.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.BotService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -305,7 +357,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -320,13 +372,13 @@ protected override void ProcessRecord() foreach( var SubscriptionId in this.SubscriptionId ) { await ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.BotsListByResourceGroup(ResourceGroupName, SubscriptionId, onOk, onDefault, this, Pipeline); + await this.Client.BotsListByResourceGroup(SubscriptionId, ResourceGroupName, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } } catch (Microsoft.Azure.PowerShell.Cmdlets.BotService.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 } }); @@ -364,12 +416,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IError /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -386,15 +438,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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 } }); @@ -404,12 +456,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotResponseList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotResponseList /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -421,15 +473,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotResponseList + 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/BotService/BotService.Autorest/generated/cmdlets/GetAzBotService_List1.cs b/generated/BotService/BotService.Autorest/generated/cmdlets/GetAzBotService_List1.cs index fe2182dd547c..986596edd1d6 100644 --- a/generated/BotService/BotService.Autorest/generated/cmdlets/GetAzBotService_List1.cs +++ b/generated/BotService/BotService.Autorest/generated/cmdlets/GetAzBotService_List1.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Cmdlets; using System; /// Returns all the resources of a particular type belonging to a subscription. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Cmdlets /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.BotService/botServices" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzBotService_List1")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot))] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Description(@"Returns all the resources of a particular type belonging to a subscription.")] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.BotService/botServices", ApiVersion = "2022-06-15-preview")] public partial class GetAzBotService_List1 : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.BotService.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 GetAzBotService_List1 : global::System.Management.Automatio /// 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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.BotService Client => Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.ClientAPI; @@ -58,6 +76,9 @@ public partial class GetAzBotService_List1 : global::System.Management.Automatio [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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 GetAzBotService_List1 : global::System.Management.Automatio /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -116,7 +137,8 @@ public partial class GetAzBotService_List1 : global::System.Management.Automatio [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -125,24 +147,24 @@ public partial class GetAzBotService_List1 : global::System.Management.Automatio /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IError /// 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.BotService.Models.Api20220615Preview.IBotResponseList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotResponseList /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -165,6 +187,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -186,7 +213,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzBotService_List1() { @@ -237,8 +264,33 @@ public GetAzBotService_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.BotService.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.BotService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -291,7 +343,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -312,7 +364,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -350,12 +402,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IError /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -372,15 +424,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -390,12 +442,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotResponseList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotResponseList /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -407,15 +459,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotResponseList + 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/BotService/BotService.Autorest/generated/cmdlets/NewAzBotServiceDirectLineKey_RegenerateExpanded.cs b/generated/BotService/BotService.Autorest/generated/cmdlets/NewAzBotServiceDirectLineKey_RegenerateExpanded.cs index a5841d4e72a1..bc79c31b681e 100644 --- a/generated/BotService/BotService.Autorest/generated/cmdlets/NewAzBotServiceDirectLineKey_RegenerateExpanded.cs +++ b/generated/BotService/BotService.Autorest/generated/cmdlets/NewAzBotServiceDirectLineKey_RegenerateExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Cmdlets; using System; /// @@ -15,12 +17,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Cmdlets /// [OpenAPI] RegenerateKeys=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/channels/{channelName}/regeneratekeys" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzBotServiceDirectLineKey_RegenerateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannel))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannel))] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Description(@"Regenerates secret keys and returns them for the DirectLine Channel of a particular BotService resource")] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/channels/{channelName}/regeneratekeys", ApiVersion = "2022-06-15-preview")] public partial class NewAzBotServiceDirectLineKey_RegenerateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -36,18 +39,33 @@ public partial class NewAzBotServiceDirectLineKey_RegenerateExpanded : global::S /// 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; + /// /// Site information for WebChat or DirectLine Channels to identify which site to regenerate keys for. /// - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInfo _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SiteInfo(); + private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ISiteInfo _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.SiteInfo(); + + /// + /// 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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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; } } + /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.RegenerateKeysChannelName _channelName; + private string _channelName; /// The name of the Channel resource for which keys are to be regenerated. [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Channel resource for which keys are to be regenerated.")] @@ -56,10 +74,10 @@ public partial class NewAzBotServiceDirectLineKey_RegenerateExpanded : global::S ReadOnly = false, Description = @"The name of the Channel resource for which keys are to be regenerated.", SerializedName = @"channelName", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.RegenerateKeysChannelName) })] + PossibleTypes = new [] { typeof(string) })] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Path)] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.RegenerateKeysChannelName))] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.RegenerateKeysChannelName ChannelName { get => this._channelName; set => this._channelName = value; } + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("WebChatChannel", "DirectLineChannel")] + public string ChannelName { get => this._channelName; set => this._channelName = value; } /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.BotService.BotService Client => Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.ClientAPI; @@ -74,6 +92,9 @@ public partial class NewAzBotServiceDirectLineKey_RegenerateExpanded : global::S [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -97,9 +118,9 @@ public partial class NewAzBotServiceDirectLineKey_RegenerateExpanded : global::S ReadOnly = false, Description = @"Determines which key is to be regenerated", SerializedName = @"key", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Key) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Key))] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Key Key { get => _parametersBody.Key; set => _parametersBody.Key = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("key1", "key2")] + public string Key { get => _parametersBody.Key ?? null; set => _parametersBody.Key = value; } /// /// cancellation delegate. Stops the cmdlet when called. @@ -112,7 +133,7 @@ public partial class NewAzBotServiceDirectLineKey_RegenerateExpanded : global::S /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.BotService.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")] @@ -183,7 +204,8 @@ public partial class NewAzBotServiceDirectLineKey_RegenerateExpanded : global::S [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -192,24 +214,24 @@ public partial class NewAzBotServiceDirectLineKey_RegenerateExpanded : global::S /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IError /// 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.BotService.Models.Api20220615Preview.IBotChannel + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannel /// 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) @@ -232,6 +254,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.BotService.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -296,8 +323,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.BotService.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.BotService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -307,7 +359,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzBotServiceDirectLineKey_RegenerateExpanded() { @@ -361,7 +413,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -374,12 +426,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.DirectLineRegenerateKeys(ResourceGroupName, ResourceName, SubscriptionId, ChannelName, _parametersBody, onOk, onDefault, this, Pipeline); + await this.Client.DirectLineRegenerateKeys(SubscriptionId, ResourceGroupName, ResourceName, ChannelName, _parametersBody, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,ResourceName=ResourceName,SubscriptionId=SubscriptionId,ChannelName=ChannelName,body=_parametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ResourceName=ResourceName,ChannelName=ChannelName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -417,12 +469,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.BotService.Models.Api20220615Preview.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IError /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -439,15 +491,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.BotService.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, ResourceName=ResourceName, SubscriptionId=SubscriptionId, ChannelName=ChannelName, body=_parametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.BotService.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, ResourceName=ResourceName, SubscriptionId=SubscriptionId, ChannelName=ChannelName, 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 } }); @@ -457,12 +509,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.BotService.Models.Api20220615Preview.IBotChannel + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannel /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -474,8 +526,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannel - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannel + 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/BotService/BotService.Autorest/generated/cmdlets/NewAzBotServicePrivateEndpointConnection_CreateExpanded.cs b/generated/BotService/BotService.Autorest/generated/cmdlets/NewAzBotServiceDirectLineKey_RegenerateViaJsonFilePath.cs similarity index 77% rename from generated/BotService/BotService.Autorest/generated/cmdlets/NewAzBotServicePrivateEndpointConnection_CreateExpanded.cs rename to generated/BotService/BotService.Autorest/generated/cmdlets/NewAzBotServiceDirectLineKey_RegenerateViaJsonFilePath.cs index 641c63c9b331..81c976d35f99 100644 --- a/generated/BotService/BotService.Autorest/generated/cmdlets/NewAzBotServicePrivateEndpointConnection_CreateExpanded.cs +++ b/generated/BotService/BotService.Autorest/generated/cmdlets/NewAzBotServiceDirectLineKey_RegenerateViaJsonFilePath.cs @@ -6,22 +6,25 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Cmdlets; using System; /// - /// Update the state of specified private endpoint connection associated with the Bot. + /// Regenerates secret keys and returns them for the DirectLine Channel of a particular BotService resource /// /// - /// [OpenAPI] Create=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}" + /// [OpenAPI] RegenerateKeys=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/channels/{channelName}/regeneratekeys" /// - [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.InternalExport] - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzBotServicePrivateEndpointConnection_CreateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnection))] - [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Description(@"Update the state of specified private endpoint connection associated with the Bot.")] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzBotServiceDirectLineKey_RegenerateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannel))] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Description(@"Regenerates secret keys and returns them for the DirectLine Channel of a particular BotService resource")] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", ApiVersion = "2022-06-15-preview")] - public partial class NewAzBotServicePrivateEndpointConnection_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/channels/{channelName}/regeneratekeys", ApiVersion = "2022-06-15-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.NotSuggestDefaultParameterSet] + public partial class NewAzBotServiceDirectLineKey_RegenerateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -37,14 +40,43 @@ public partial class NewAzBotServicePrivateEndpointConnection_CreateExpanded : g /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); - /// The Private Endpoint Connection resource. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnection _propertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateEndpointConnection(); + /// 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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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; } } + + /// Backing field for property. + private string _channelName; + + /// The name of the Channel resource for which keys are to be regenerated. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Channel resource for which keys are to be regenerated.")] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Channel resource for which keys are to be regenerated.", + SerializedName = @"channelName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Path)] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("WebChatChannel", "DirectLineChannel")] + public string ChannelName { get => this._channelName; set => this._channelName = value; } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.BotService.BotService Client => Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.ClientAPI; @@ -58,6 +90,9 @@ public partial class NewAzBotServicePrivateEndpointConnection_CreateExpanded : g [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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] @@ -73,71 +108,31 @@ public partial class NewAzBotServicePrivateEndpointConnection_CreateExpanded : g /// 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.BotService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - - /// cancellation token. - global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + /// Backing field for property. + private string _jsonFilePath; - /// Backing field for property. - private string _name; - - /// The name of the private endpoint connection associated with the Azure resource - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the private endpoint connection associated with the Azure resource")] + /// Path of Json file supplied to the Regenerate operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Regenerate operation")] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = true, ReadOnly = false, - Description = @"The name of the private endpoint connection associated with the Azure resource", - SerializedName = @"privateEndpointConnectionName", + Description = @"Path of Json file supplied to the Regenerate operation", + SerializedName = @"JsonFilePath", PossibleTypes = new [] { typeof(string) })] - [global::System.Management.Automation.Alias("PrivateEndpointConnectionName")] - [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.HttpPipeline Pipeline { get; set; } + 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; } } /// - /// A message indicating if changes on the service provider require any updates on the consumer. + /// cancellation delegate. Stops the cmdlet when called. /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "A message indicating if changes on the service provider require any updates on the consumer.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"A message indicating if changes on the service provider require any updates on the consumer.", - SerializedName = @"actionsRequired", - PossibleTypes = new [] { typeof(string) })] - public string PrivateLinkServiceConnectionStateActionsRequired { get => _propertiesBody.PrivateLinkServiceConnectionStateActionsRequired ?? null; set => _propertiesBody.PrivateLinkServiceConnectionStateActionsRequired = value; } + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - /// The reason for approval/rejection of the connection. - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The reason for approval/rejection of the connection.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The reason for approval/rejection of the connection.", - SerializedName = @"description", - PossibleTypes = new [] { typeof(string) })] - public string PrivateLinkServiceConnectionStateDescription { get => _propertiesBody.PrivateLinkServiceConnectionStateDescription ?? null; set => _propertiesBody.PrivateLinkServiceConnectionStateDescription = value; } + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; /// - /// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + /// The instance of the that the remote call will use. /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service.", - SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointServiceConnectionStatus) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointServiceConnectionStatus))] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointServiceConnectionStatus PrivateLinkServiceConnectionStateStatus { get => _propertiesBody.PrivateLinkServiceConnectionStateStatus ?? ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointServiceConnectionStatus)""); set => _propertiesBody.PrivateLinkServiceConnectionStateStatus = value; } + public Microsoft.Azure.PowerShell.Cmdlets.BotService.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")] @@ -197,7 +192,8 @@ public partial class NewAzBotServicePrivateEndpointConnection_CreateExpanded : g [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -206,24 +202,24 @@ public partial class NewAzBotServicePrivateEndpointConnection_CreateExpanded : 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.BotService.Models.Api20220615Preview.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IError /// 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.BotService.Models.Api20220615Preview.IPrivateEndpointConnection + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannel /// 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) @@ -246,6 +242,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.BotService.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -310,8 +311,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.BotService.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.BotService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -321,9 +347,9 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// - public NewAzBotServicePrivateEndpointConnection_CreateExpanded() + public NewAzBotServiceDirectLineKey_RegenerateViaJsonFilePath() { } @@ -336,7 +362,7 @@ protected override void ProcessRecord() try { // work - if (ShouldProcess($"Call remote 'PrivateEndpointConnectionsCreate' operation")) + if (ShouldProcess($"Call remote 'DirectLineRegenerateKeys' operation")) { using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token) ) { @@ -375,7 +401,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -388,12 +414,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.PrivateEndpointConnectionsCreate(ResourceGroupName, ResourceName, SubscriptionId, Name, _propertiesBody, onOk, onDefault, this, Pipeline); + await this.Client.DirectLineRegenerateKeysViaJsonString(SubscriptionId, ResourceGroupName, ResourceName, ChannelName, _jsonString, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,ResourceName=ResourceName,SubscriptionId=SubscriptionId,Name=Name,body=_propertiesBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ResourceName=ResourceName,ChannelName=ChannelName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -431,12 +457,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.BotService.Models.Api20220615Preview.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IError /// 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 ) { @@ -453,15 +479,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.BotService.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, ResourceName=ResourceName, SubscriptionId=SubscriptionId, Name=Name, body=_propertiesBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.BotService.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, ResourceName=ResourceName, SubscriptionId=SubscriptionId, Name=Name, body=_propertiesBody }) + 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 } }); @@ -471,12 +497,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.BotService.Models.Api20220615Preview.IPrivateEndpointConnection + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannel /// 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 ) { @@ -488,8 +514,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnection - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannel + 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/BotService/BotService.Autorest/generated/cmdlets/NewAzBotServiceDirectLineKey_Regenerate.cs b/generated/BotService/BotService.Autorest/generated/cmdlets/NewAzBotServiceDirectLineKey_RegenerateViaJsonString.cs similarity index 80% rename from generated/BotService/BotService.Autorest/generated/cmdlets/NewAzBotServiceDirectLineKey_Regenerate.cs rename to generated/BotService/BotService.Autorest/generated/cmdlets/NewAzBotServiceDirectLineKey_RegenerateViaJsonString.cs index 08648ca478d1..58133c74a74b 100644 --- a/generated/BotService/BotService.Autorest/generated/cmdlets/NewAzBotServiceDirectLineKey_Regenerate.cs +++ b/generated/BotService/BotService.Autorest/generated/cmdlets/NewAzBotServiceDirectLineKey_RegenerateViaJsonString.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Cmdlets; using System; /// @@ -14,14 +16,15 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Cmdlets /// /// [OpenAPI] RegenerateKeys=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/channels/{channelName}/regeneratekeys" /// - [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.InternalExport] - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzBotServiceDirectLineKey_Regenerate", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannel))] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzBotServiceDirectLineKey_RegenerateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannel))] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Description(@"Regenerates secret keys and returns them for the DirectLine Channel of a particular BotService resource")] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/channels/{channelName}/regeneratekeys", ApiVersion = "2022-06-15-preview")] - public partial class NewAzBotServiceDirectLineKey_Regenerate : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.NotSuggestDefaultParameterSet] + public partial class NewAzBotServiceDirectLineKey_RegenerateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -37,13 +40,28 @@ public partial class NewAzBotServiceDirectLineKey_Regenerate : 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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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; } } + /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.RegenerateKeysChannelName _channelName; + private string _channelName; /// The name of the Channel resource for which keys are to be regenerated. [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Channel resource for which keys are to be regenerated.")] @@ -52,10 +70,10 @@ public partial class NewAzBotServiceDirectLineKey_Regenerate : global::System.Ma ReadOnly = false, Description = @"The name of the Channel resource for which keys are to be regenerated.", SerializedName = @"channelName", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.RegenerateKeysChannelName) })] + PossibleTypes = new [] { typeof(string) })] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Path)] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.RegenerateKeysChannelName))] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.RegenerateKeysChannelName ChannelName { get => this._channelName; set => this._channelName = value; } + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("WebChatChannel", "DirectLineChannel")] + public string ChannelName { get => this._channelName; set => this._channelName = value; } /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.BotService.BotService Client => Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.ClientAPI; @@ -70,6 +88,9 @@ public partial class NewAzBotServiceDirectLineKey_Regenerate : global::System.Ma [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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,6 +106,19 @@ public partial class NewAzBotServiceDirectLineKey_Regenerate : global::System.Ma /// 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 Regenerate operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Regenerate operation")] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Regenerate operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = value; } + /// /// cancellation delegate. Stops the cmdlet when called. /// @@ -93,25 +127,10 @@ public partial class NewAzBotServiceDirectLineKey_Regenerate : global::System.Ma /// cancellation token. global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInfo _parameter; - - /// - /// Site information for WebChat or DirectLine Channels to identify which site to regenerate keys for. - /// - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Site information for WebChat or DirectLine Channels to identify which site to regenerate keys for.", ValueFromPipeline = true)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"Site information for WebChat or DirectLine Channels to identify which site to regenerate keys for.", - SerializedName = @"parameters", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInfo) })] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInfo Parameter { get => this._parameter; set => this._parameter = value; } - /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.BotService.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")] @@ -171,7 +190,8 @@ public partial class NewAzBotServiceDirectLineKey_Regenerate : global::System.Ma [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -180,24 +200,24 @@ public partial class NewAzBotServiceDirectLineKey_Regenerate : 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.BotService.Models.Api20220615Preview.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IError /// 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.BotService.Models.Api20220615Preview.IBotChannel + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannel /// 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 +240,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -284,8 +309,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -295,9 +345,9 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// - public NewAzBotServiceDirectLineKey_Regenerate() + public NewAzBotServiceDirectLineKey_RegenerateViaJsonString() { } @@ -349,7 +399,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -362,12 +412,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.DirectLineRegenerateKeys(ResourceGroupName, ResourceName, SubscriptionId, ChannelName, Parameter, onOk, onDefault, this, Pipeline); + await this.Client.DirectLineRegenerateKeysViaJsonString(SubscriptionId, ResourceGroupName, ResourceName, ChannelName, _jsonString, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,ResourceName=ResourceName,SubscriptionId=SubscriptionId,ChannelName=ChannelName,body=Parameter}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ResourceName=ResourceName,ChannelName=ChannelName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -405,12 +455,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.BotService.Models.Api20220615Preview.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IError /// 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 +477,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.BotService.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, ResourceName=ResourceName, SubscriptionId=SubscriptionId, ChannelName=ChannelName, body=Parameter }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.BotService.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, ResourceName=ResourceName, SubscriptionId=SubscriptionId, ChannelName=ChannelName, 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 } }); @@ -445,12 +495,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.BotService.Models.Api20220615Preview.IBotChannel + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannel /// 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 +512,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannel - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotChannel + 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/BotService/BotService.Autorest/generated/cmdlets/NewAzBotService_CreateExpanded.cs b/generated/BotService/BotService.Autorest/generated/cmdlets/NewAzBotService_CreateExpanded.cs index 7f371fab0885..7db73b2211ae 100644 --- a/generated/BotService/BotService.Autorest/generated/cmdlets/NewAzBotService_CreateExpanded.cs +++ b/generated/BotService/BotService.Autorest/generated/cmdlets/NewAzBotService_CreateExpanded.cs @@ -6,20 +6,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Cmdlets; using System; - /// Creates a Bot Service. Bot Service is a resource group wide resource type. + /// create a Bot Service. Bot Service is a resource group wide resource type. /// /// [OpenAPI] Create=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}" /// [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzBotService_CreateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot))] - [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Description(@"Creates a Bot Service. Bot Service is a resource group wide resource type.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot))] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Description(@"create a Bot Service. Bot Service is a resource group wide resource type.")] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}", ApiVersion = "2022-06-15-preview")] public partial class NewAzBotService_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,8 +38,20 @@ public partial class NewAzBotService_CreateExpanded : 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; + /// Bot resource definition - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Bot(); + private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Bot(); + + /// + /// 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; /// Contains resource all settings defined as key/value pairs. [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ExportAs(typeof(global::System.Collections.Hashtable))] @@ -47,8 +62,8 @@ public partial class NewAzBotService_CreateExpanded : global::System.Management. ReadOnly = false, Description = @"Contains resource all settings defined as key/value pairs.", SerializedName = @"allSettings", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesAllSettings) })] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesAllSettings AllSetting { get => _parametersBody.AllSetting ?? null /* object */; set => _parametersBody.AllSetting = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesAllSettings) })] + public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesAllSettings AllSetting { get => _parametersBody.AllSetting ?? null /* object */; set => _parametersBody.AllSetting = value; } /// The hint (e.g. keyVault secret resourceId) on how to fetch the app secret [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The hint (e.g. keyVault secret resourceId) on how to fetch the app secret")] @@ -66,6 +81,9 @@ public partial class NewAzBotService_CreateExpanded : global::System.Management. [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.BotService Client => Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.ClientAPI; @@ -180,6 +198,9 @@ public partial class NewAzBotService_CreateExpanded : global::System.Management. PossibleTypes = new [] { typeof(string) })] public string Etag { get => _parametersBody.Etag ?? null; set => _parametersBody.Etag = 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] @@ -236,9 +257,9 @@ public partial class NewAzBotService_CreateExpanded : global::System.Management. ReadOnly = false, Description = @"Required. Gets or sets the Kind of the resource.", SerializedName = @"kind", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Kind) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Kind))] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Kind Kind { get => _parametersBody.Kind ?? ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Kind)""); set => _parametersBody.Kind = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("sdk", "designer", "bot", "function", "azurebot")] + public string Kind { get => _parametersBody.Kind ?? null; set => _parametersBody.Kind = value; } /// Specifies the location of the resource. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the location of the resource.")] @@ -261,7 +282,7 @@ public partial class NewAzBotService_CreateExpanded : global::System.Management. Description = @"Collection of LUIS App Ids", SerializedName = @"luisAppIds", PossibleTypes = new [] { typeof(string) })] - public string[] LuisAppId { get => _parametersBody.LuisAppId ?? null /* arrayOf */; set => _parametersBody.LuisAppId = value; } + public string[] LuisAppId { get => _parametersBody.LuisAppId?.ToArray() ?? null /* fixedArrayOf */; set => _parametersBody.LuisAppId = (value != null ? new System.Collections.Generic.List(value) : null); } /// The LUIS Key [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The LUIS Key")] @@ -334,9 +355,9 @@ public partial class NewAzBotService_CreateExpanded : global::System.Management. ReadOnly = false, Description = @"Microsoft App Type for the bot", SerializedName = @"msaAppType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.MsaAppType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.MsaAppType))] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.MsaAppType MsaAppType { get => _parametersBody.MsaAppType ?? ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.MsaAppType)""); set => _parametersBody.MsaAppType = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("UserAssignedMSI", "SingleTenant", "MultiTenant")] + public string MsaAppType { get => _parametersBody.MsaAppType ?? null; set => _parametersBody.MsaAppType = value; } /// Backing field for property. private string _name; @@ -375,13 +396,13 @@ public partial class NewAzBotService_CreateExpanded : global::System.Management. ReadOnly = false, Description = @"Contains resource parameters defined as key/value pairs.", SerializedName = @"parameters", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesParameters) })] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesParameters Parameter { get => _parametersBody.Parameter ?? null /* object */; set => _parametersBody.Parameter = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesParameters) })] + public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesParameters Parameter { get => _parametersBody.Parameter ?? null /* object */; set => _parametersBody.Parameter = value; } /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.BotService.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")] @@ -407,9 +428,9 @@ public partial class NewAzBotService_CreateExpanded : global::System.Management. ReadOnly = false, Description = @"Whether the bot is in an isolated network", SerializedName = @"publicNetworkAccess", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PublicNetworkAccess) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PublicNetworkAccess))] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PublicNetworkAccess PublicNetworkAccess { get => _parametersBody.PublicNetworkAccess ?? ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PublicNetworkAccess)""); set => _parametersBody.PublicNetworkAccess = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("Enabled", "Disabled")] + public string PublicNetworkAccess { get => _parametersBody.PublicNetworkAccess ?? null; set => _parametersBody.PublicNetworkAccess = value; } /// Publishing credentials of the resource [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Publishing credentials of the resource")] @@ -455,9 +476,9 @@ public partial class NewAzBotService_CreateExpanded : global::System.Management. ReadOnly = false, Description = @"The sku name", SerializedName = @"name", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName))] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName SkuName { get => _parametersBody.SkuName ?? ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName)""); set => _parametersBody.SkuName = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("F0", "S1")] + public string SkuName { get => _parametersBody.SkuName ?? null; set => _parametersBody.SkuName = value; } /// The storage resourceId for the bot [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The storage resourceId for the bot")] @@ -484,7 +505,8 @@ public partial class NewAzBotService_CreateExpanded : global::System.Management. [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -497,8 +519,8 @@ public partial class NewAzBotService_CreateExpanded : global::System.Management. ReadOnly = false, Description = @"Contains resource tags defined as key/value pairs.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceTags Tag { get => _parametersBody.Tag ?? null /* object */; set => _parametersBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceTags Tag { get => _parametersBody.Tag ?? null /* object */; set => _parametersBody.Tag = value; } /// The Tenant Id for the bot [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The Tenant Id for the bot")] @@ -516,36 +538,36 @@ public partial class NewAzBotService_CreateExpanded : 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.BotService.Models.Api20220615Preview.IBot + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot /// 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.BotService.Models.Api20220615Preview.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IError /// 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.BotService.Models.Api20220615Preview.IBot + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot /// 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) @@ -568,6 +590,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.BotService.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -632,8 +659,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.BotService.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.BotService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -643,7 +695,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzBotService_CreateExpanded() { @@ -697,7 +749,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -710,12 +762,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.BotsCreate(ResourceGroupName, Name, SubscriptionId, _parametersBody, onOk, onCreated, onDefault, this, Pipeline); + await this.Client.BotsCreate(SubscriptionId, ResourceGroupName, Name, _parametersBody, onOk, onCreated, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeCreate); await ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.BotService.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 } }); @@ -751,12 +803,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.BotService.Models.Api20220615Preview.IBot + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot /// 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 ) { @@ -768,8 +820,26 @@ protected override void StopProcessing() return ; } // onCreated - response for 201 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot + 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; + } + } } } @@ -777,12 +847,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.BotService.Models.Api20220615Preview.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IError /// 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 ) { @@ -799,15 +869,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.BotService.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.BotService.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 } }); @@ -817,12 +887,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.BotService.Models.Api20220615Preview.IBot + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot /// 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 ) { @@ -834,8 +904,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot + 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/BotService/BotService.Autorest/generated/cmdlets/NewAzBotService_CreateViaJsonFilePath.cs b/generated/BotService/BotService.Autorest/generated/cmdlets/NewAzBotService_CreateViaJsonFilePath.cs new file mode 100644 index 000000000000..12d2f6a9965f --- /dev/null +++ b/generated/BotService/BotService.Autorest/generated/cmdlets/NewAzBotService_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.BotService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Cmdlets; + using System; + + /// create a Bot Service. Bot Service is a resource group wide resource type. + /// + /// [OpenAPI] Create=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzBotService_CreateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot))] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Description(@"create a Bot Service. Bot Service is a resource group wide resource type.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}", ApiVersion = "2022-06-15-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.NotSuggestDefaultParameterSet] + public partial class NewAzBotService_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.BotService Client => Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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.BotService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the Bot resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Bot resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Bot resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("BotName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the Bot resource group in the user subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Bot resource group in the user subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Bot resource group in the user subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// Azure Subscription ID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Azure Subscription ID.")] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Azure Subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.IBot + /// 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.BotService.Models.IError + /// 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.BotService.Models.IBot + /// 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.BotService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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.BotService.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.BotService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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.BotService.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.BotService.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 NewAzBotService_CreateViaJsonFilePath() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BotsCreate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BotsCreateViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, onOk, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.IBot + /// 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.BotService.Models.IBot + 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.BotService.Models.IError + /// 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.BotService.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.BotService.Models.IBot + /// 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.BotService.Models.IBot + 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/BotService/BotService.Autorest/generated/cmdlets/NewAzBotService_CreateViaJsonString.cs b/generated/BotService/BotService.Autorest/generated/cmdlets/NewAzBotService_CreateViaJsonString.cs new file mode 100644 index 000000000000..2601586d0551 --- /dev/null +++ b/generated/BotService/BotService.Autorest/generated/cmdlets/NewAzBotService_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.BotService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Cmdlets; + using System; + + /// create a Bot Service. Bot Service is a resource group wide resource type. + /// + /// [OpenAPI] Create=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzBotService_CreateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot))] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Description(@"create a Bot Service. Bot Service is a resource group wide resource type.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}", ApiVersion = "2022-06-15-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.NotSuggestDefaultParameterSet] + public partial class NewAzBotService_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.BotService Client => Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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.BotService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the Bot resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Bot resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Bot resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("BotName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the Bot resource group in the user subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Bot resource group in the user subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Bot resource group in the user subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// Azure Subscription ID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Azure Subscription ID.")] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Azure Subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.IBot + /// 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.BotService.Models.IError + /// 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.BotService.Models.IBot + /// 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.BotService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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.BotService.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.BotService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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.BotService.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.BotService.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 NewAzBotService_CreateViaJsonString() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BotsCreate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BotsCreateViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, onOk, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.IBot + /// 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.BotService.Models.IBot + 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.BotService.Models.IError + /// 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.BotService.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.BotService.Models.IBot + /// 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.BotService.Models.IBot + 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/BotService/BotService.Autorest/generated/cmdlets/RemoveAzBotServicePrivateEndpointConnection_DeleteViaIdentity.cs b/generated/BotService/BotService.Autorest/generated/cmdlets/RemoveAzBotServicePrivateEndpointConnection_DeleteViaIdentity.cs deleted file mode 100644 index ca4b21752887..000000000000 --- a/generated/BotService/BotService.Autorest/generated/cmdlets/RemoveAzBotServicePrivateEndpointConnection_DeleteViaIdentity.cs +++ /dev/null @@ -1,463 +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.BotService.Cmdlets -{ - using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; - using System; - - /// Deletes the specified private endpoint connection associated with the Bot. - /// - /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}" - /// - [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.InternalExport] - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzBotServicePrivateEndpointConnection_DeleteViaIdentity", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(bool))] - [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Description(@"Deletes the specified private endpoint connection associated with the Bot.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", ApiVersion = "2022-06-15-preview")] - public partial class RemoveAzBotServicePrivateEndpointConnection_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener - { - /// 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(); - - /// 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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter Break { get; set; } - - /// The reference to the client API class. - public Microsoft.Azure.PowerShell.Cmdlets.BotService.BotService Client => Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Azure)] - public global::System.Management.Automation.PSObject DefaultProfile { get; set; } - - /// 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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentity _inputObject; - - /// Identity Parameter - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] - [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Path)] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentity 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.BotService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - - /// cancellation token. - global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; - - /// - /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] - [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter PassThru { get; set; } - - /// - /// The instance of the that the remote call will use. - /// - private Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } - - /// - /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what - /// happens on that response. Implement this method in a partial class to enable this behavior - /// - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IError - /// 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); - - /// - /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of - /// what happens on that response. Implement this method in a partial class to enable this behavior - /// - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// /// Determines if the rest of the onNoContent method should be processed, or if the method should - /// return immediately (set to true to skip further processing ) - - partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); - - /// - /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens - /// on that response. Implement this method in a partial class to enable this behavior - /// - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// /// Determines if the rest of the onOk method should be processed, or if the method should return - /// immediately (set to true to skip further processing ) - - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); - - /// - /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) - /// - protected override void BeginProcessing() - { - var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.GetTelemetryId.Invoke(); - if (telemetryId != "" && telemetryId != "internal") - { - __correlationId = telemetryId; - } - Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); - if (Break) - { - Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.AttachDebugger.Break(); - } - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - - /// Performs clean-up after the command execution - protected override void EndProcessing() - { - var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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.BotService.Runtime.Events.Verbose: - { - WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Warning: - { - WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Information: - { - var data = messageData(); - WriteInformation(data.Message, new string[]{}); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Debug: - { - WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.BotService.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 ; - } - } - await Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - __processRecordId = System.Guid.NewGuid().ToString(); - try - { - // work - if (ShouldProcess($"Call remote 'PrivateEndpointConnectionsDelete' operation")) - { - using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token) ) - { - asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); - if (null != HttpPipelinePrepend) - { - Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); - } - if (null != HttpPipelineAppend) - { - Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); - } - // get the client instance - try - { - await ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - if (InputObject?.Id != null) - { - await this.Client.PrivateEndpointConnectionsDeleteViaIdentity(InputObject.Id, onOk, onNoContent, 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.ResourceName) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceName"),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) ); - } - if (null == InputObject.PrivateEndpointConnectionName) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PrivateEndpointConnectionName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); - } - await this.Client.PrivateEndpointConnectionsDelete(InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, InputObject.SubscriptionId ?? null, InputObject.PrivateEndpointConnectionName ?? null, onOk, onNoContent, onDefault, this, Pipeline); - } - await ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - catch (Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletProcessRecordAsyncEnd); - } - } - } - - /// - /// Intializes a new instance of the cmdlet class. - /// - public RemoveAzBotServicePrivateEndpointConnection_DeleteViaIdentity() - { - - } - - /// Interrupts currently running code within the command. - protected override void StopProcessing() - { - ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Cancel(); - base.StopProcessing(); - } - - /// - new protected void WriteObject(object sendToPipeline) - { - Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline); - } - - /// - /// - new protected void WriteObject(object sendToPipeline, bool enumerateCollection) - { - Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.Api20220615Preview.IError - /// 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.BotService.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 204 (NoContent). - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// - /// A that will be complete when handling of the method is completed. - /// - private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) - { - using( NoSynchronizationContext ) - { - var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); - overrideOnNoContent(responseMessage, ref _returnNow); - // if overrideOnNoContent has returned true, then return right away. - if ((null != _returnNow && await _returnNow)) - { - return ; - } - // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) - { - WriteObject(true); - } - } - } - - /// a delegate that is called when the remote service returns 200 (OK). - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// - /// A that will be complete when handling of the method is completed. - /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) - { - using( NoSynchronizationContext ) - { - var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); - overrideOnOk(responseMessage, ref _returnNow); - // if overrideOnOk has returned true, then return right away. - if ((null != _returnNow && await _returnNow)) - { - return ; - } - // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) - { - WriteObject(true); - } - } - } - } -} \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/cmdlets/RemoveAzBotService_Delete.cs b/generated/BotService/BotService.Autorest/generated/cmdlets/RemoveAzBotService_Delete.cs index 608f3b7a8df9..4ff9b6bbf721 100644 --- a/generated/BotService/BotService.Autorest/generated/cmdlets/RemoveAzBotService_Delete.cs +++ b/generated/BotService/BotService.Autorest/generated/cmdlets/RemoveAzBotService_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Cmdlets; using System; /// Deletes a Bot Service from the resource group. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}", ApiVersion = "2022-06-15-preview")] public partial class RemoveAzBotService_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.BotService.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 RemoveAzBotService_Delete : 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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.BotService Client => Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class RemoveAzBotService_Delete : global::System.Management.Autom [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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 RemoveAzBotService_Delete : global::System.Management.Autom /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.BotService.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 RemoveAzBotService_Delete : global::System.Management.Autom [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -155,12 +177,12 @@ public partial class RemoveAzBotService_Delete : 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.BotService.Models.Api20220615Preview.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IError /// 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.BotService.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.BotService.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.BotService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -337,12 +389,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.BotsDelete(ResourceGroupName, Name, SubscriptionId, onOk, onNoContent, onDefault, this, Pipeline); + await this.Client.BotsDelete(SubscriptionId, ResourceGroupName, Name, onOk, onNoContent, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.BotService.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 RemoveAzBotService_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.BotService.Models.Api20220615Preview.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IError /// 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.BotService.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.BotService.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 } }); diff --git a/generated/BotService/BotService.Autorest/generated/cmdlets/RemoveAzBotService_DeleteViaIdentity.cs b/generated/BotService/BotService.Autorest/generated/cmdlets/RemoveAzBotService_DeleteViaIdentity.cs index bc359bca7a26..136673aedd7c 100644 --- a/generated/BotService/BotService.Autorest/generated/cmdlets/RemoveAzBotService_DeleteViaIdentity.cs +++ b/generated/BotService/BotService.Autorest/generated/cmdlets/RemoveAzBotService_DeleteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Cmdlets; using System; /// Deletes a Bot Service from the resource group. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}", ApiVersion = "2022-06-15-preview")] public partial class RemoveAzBotService_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.BotService.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 RemoveAzBotService_DeleteViaIdentity : 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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.BotService Client => Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class RemoveAzBotService_DeleteViaIdentity : global::System.Manag [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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 RemoveAzBotService_DeleteViaIdentity : global::System.Manag /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.BotService.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 RemoveAzBotService_DeleteViaIdentity : 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.BotService.Models.Api20220615Preview.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IError /// 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.BotService.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.BotService.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.BotService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.BotService.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.ResourceName"),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.BotsDelete(InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, InputObject.SubscriptionId ?? null, onOk, onNoContent, onDefault, this, Pipeline); + await this.Client.BotsDelete(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, onOk, onNoContent, onDefault, this, Pipeline); } await ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.BotService.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 RemoveAzBotService_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.BotService.Models.Api20220615Preview.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IError /// 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.BotService.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.RestException(responseMessage, await response); WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } diff --git a/generated/BotService/BotService.Autorest/generated/cmdlets/UpdateAzBotService_UpdateExpanded.cs b/generated/BotService/BotService.Autorest/generated/cmdlets/UpdateAzBotService_UpdateExpanded.cs index d021da7414cb..fdcd9d7d5fa5 100644 --- a/generated/BotService/BotService.Autorest/generated/cmdlets/UpdateAzBotService_UpdateExpanded.cs +++ b/generated/BotService/BotService.Autorest/generated/cmdlets/UpdateAzBotService_UpdateExpanded.cs @@ -6,19 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Cmdlets; using System; - /// Updates a Bot Service + /// update a Bot Service /// /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzBotService_UpdateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot))] - [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Description(@"Updates a Bot Service")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot))] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Description(@"update a Bot Service")] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}", ApiVersion = "2022-06-15-preview")] public partial class UpdateAzBotService_UpdateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,8 +37,20 @@ public partial class UpdateAzBotService_UpdateExpanded : 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; + /// Bot resource definition - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Bot(); + private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Bot(); + + /// + /// 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; /// Contains resource all settings defined as key/value pairs. [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ExportAs(typeof(global::System.Collections.Hashtable))] @@ -46,8 +61,8 @@ public partial class UpdateAzBotService_UpdateExpanded : global::System.Manageme ReadOnly = false, Description = @"Contains resource all settings defined as key/value pairs.", SerializedName = @"allSettings", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesAllSettings) })] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesAllSettings AllSetting { get => _parametersBody.AllSetting ?? null /* object */; set => _parametersBody.AllSetting = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesAllSettings) })] + public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesAllSettings AllSetting { get => _parametersBody.AllSetting ?? null /* object */; set => _parametersBody.AllSetting = value; } /// The hint (e.g. keyVault secret resourceId) on how to fetch the app secret [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The hint (e.g. keyVault secret resourceId) on how to fetch the app secret")] @@ -65,6 +80,9 @@ public partial class UpdateAzBotService_UpdateExpanded : global::System.Manageme [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.BotService Client => Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.ClientAPI; @@ -179,6 +197,9 @@ public partial class UpdateAzBotService_UpdateExpanded : global::System.Manageme PossibleTypes = new [] { typeof(string) })] public string Etag { get => _parametersBody.Etag ?? null; set => _parametersBody.Etag = 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] @@ -235,9 +256,9 @@ public partial class UpdateAzBotService_UpdateExpanded : global::System.Manageme ReadOnly = false, Description = @"Required. Gets or sets the Kind of the resource.", SerializedName = @"kind", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Kind) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Kind))] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Kind Kind { get => _parametersBody.Kind ?? ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Kind)""); set => _parametersBody.Kind = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("sdk", "designer", "bot", "function", "azurebot")] + public string Kind { get => _parametersBody.Kind ?? null; set => _parametersBody.Kind = value; } /// Specifies the location of the resource. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the location of the resource.")] @@ -260,7 +281,7 @@ public partial class UpdateAzBotService_UpdateExpanded : global::System.Manageme Description = @"Collection of LUIS App Ids", SerializedName = @"luisAppIds", PossibleTypes = new [] { typeof(string) })] - public string[] LuisAppId { get => _parametersBody.LuisAppId ?? null /* arrayOf */; set => _parametersBody.LuisAppId = value; } + public string[] LuisAppId { get => _parametersBody.LuisAppId?.ToArray() ?? null /* fixedArrayOf */; set => _parametersBody.LuisAppId = (value != null ? new System.Collections.Generic.List(value) : null); } /// The LUIS Key [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The LUIS Key")] @@ -292,17 +313,6 @@ public partial class UpdateAzBotService_UpdateExpanded : global::System.Manageme /// cancellation token. global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; - /// Microsoft App Id for the bot - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Microsoft App Id for the bot")] - [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Microsoft App Id for the bot", - SerializedName = @"msaAppId", - PossibleTypes = new [] { typeof(string) })] - public string MsaAppId { get => _parametersBody.MsaAppId ?? null; set => _parametersBody.MsaAppId = value; } - /// Microsoft App Managed Identity Resource Id for the bot [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Microsoft App Managed Identity Resource Id for the bot")] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Body)] @@ -314,17 +324,6 @@ public partial class UpdateAzBotService_UpdateExpanded : global::System.Manageme PossibleTypes = new [] { typeof(string) })] public string MsaAppMsiResourceId { get => _parametersBody.MsaAppMsiResourceId ?? null; set => _parametersBody.MsaAppMsiResourceId = value; } - /// Microsoft App Tenant Id for the bot - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Microsoft App Tenant Id for the bot")] - [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Microsoft App Tenant Id for the bot", - SerializedName = @"msaAppTenantId", - PossibleTypes = new [] { typeof(string) })] - public string MsaAppTenantId { get => _parametersBody.MsaAppTenantId ?? null; set => _parametersBody.MsaAppTenantId = value; } - /// Microsoft App Type for the bot [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Microsoft App Type for the bot")] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Body)] @@ -333,9 +332,9 @@ public partial class UpdateAzBotService_UpdateExpanded : global::System.Manageme ReadOnly = false, Description = @"Microsoft App Type for the bot", SerializedName = @"msaAppType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.MsaAppType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.MsaAppType))] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.MsaAppType MsaAppType { get => _parametersBody.MsaAppType ?? ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.MsaAppType)""); set => _parametersBody.MsaAppType = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("UserAssignedMSI", "SingleTenant", "MultiTenant")] + public string MsaAppType { get => _parametersBody.MsaAppType ?? null; set => _parametersBody.MsaAppType = value; } /// Backing field for property. private string _name; @@ -374,13 +373,13 @@ public partial class UpdateAzBotService_UpdateExpanded : global::System.Manageme ReadOnly = false, Description = @"Contains resource parameters defined as key/value pairs.", SerializedName = @"parameters", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesParameters) })] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesParameters Parameter { get => _parametersBody.Parameter ?? null /* object */; set => _parametersBody.Parameter = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesParameters) })] + public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesParameters Parameter { get => _parametersBody.Parameter ?? null /* object */; set => _parametersBody.Parameter = value; } /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.BotService.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")] @@ -406,9 +405,9 @@ public partial class UpdateAzBotService_UpdateExpanded : global::System.Manageme ReadOnly = false, Description = @"Whether the bot is in an isolated network", SerializedName = @"publicNetworkAccess", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PublicNetworkAccess) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PublicNetworkAccess))] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PublicNetworkAccess PublicNetworkAccess { get => _parametersBody.PublicNetworkAccess ?? ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PublicNetworkAccess)""); set => _parametersBody.PublicNetworkAccess = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("Enabled", "Disabled")] + public string PublicNetworkAccess { get => _parametersBody.PublicNetworkAccess ?? null; set => _parametersBody.PublicNetworkAccess = value; } /// Publishing credentials of the resource [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Publishing credentials of the resource")] @@ -454,9 +453,9 @@ public partial class UpdateAzBotService_UpdateExpanded : global::System.Manageme ReadOnly = false, Description = @"The sku name", SerializedName = @"name", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName))] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName SkuName { get => _parametersBody.SkuName ?? ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName)""); set => _parametersBody.SkuName = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("F0", "S1")] + public string SkuName { get => _parametersBody.SkuName ?? null; set => _parametersBody.SkuName = value; } /// The storage resourceId for the bot [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The storage resourceId for the bot")] @@ -483,7 +482,8 @@ public partial class UpdateAzBotService_UpdateExpanded : global::System.Manageme [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -496,55 +496,44 @@ public partial class UpdateAzBotService_UpdateExpanded : global::System.Manageme ReadOnly = false, Description = @"Contains resource tags defined as key/value pairs.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceTags Tag { get => _parametersBody.Tag ?? null /* object */; set => _parametersBody.Tag = value; } - - /// The Tenant Id for the bot - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The Tenant Id for the bot")] - [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The Tenant Id for the bot", - SerializedName = @"tenantId", - PossibleTypes = new [] { typeof(string) })] - public string TenantId { get => _parametersBody.TenantId ?? null; set => _parametersBody.TenantId = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceTags Tag { get => _parametersBody.Tag ?? null /* object */; set => _parametersBody.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.BotService.Models.Api20220615Preview.IBot + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot /// 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.BotService.Models.Api20220615Preview.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IError /// 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.BotService.Models.Api20220615Preview.IBot + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot /// 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) @@ -567,6 +556,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.BotService.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -631,8 +625,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.BotService.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.BotService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -688,7 +707,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -701,12 +720,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.BotsUpdate(ResourceGroupName, Name, SubscriptionId, _parametersBody, onOk, onCreated, onDefault, this, Pipeline); + await this.Client.BotsUpdate(SubscriptionId, ResourceGroupName, Name, _parametersBody, onOk, onCreated, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeUpdate); await ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.BotService.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 } }); @@ -726,7 +745,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzBotService_UpdateExpanded() { @@ -750,12 +769,12 @@ public UpdateAzBotService_UpdateExpanded() /// 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.BotService.Models.Api20220615Preview.IBot + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot /// 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 ) { @@ -767,8 +786,26 @@ public UpdateAzBotService_UpdateExpanded() return ; } // onCreated - response for 201 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot + 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; + } + } } } @@ -776,12 +813,12 @@ public UpdateAzBotService_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.BotService.Models.Api20220615Preview.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IError /// 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 ) { @@ -798,15 +835,15 @@ public UpdateAzBotService_UpdateExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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 } }); @@ -816,12 +853,12 @@ public UpdateAzBotService_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.BotService.Models.Api20220615Preview.IBot + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot /// 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 ) { @@ -833,8 +870,26 @@ public UpdateAzBotService_UpdateExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot + 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/BotService/BotService.Autorest/generated/cmdlets/UpdateAzBotService_UpdateViaIdentityExpanded.cs b/generated/BotService/BotService.Autorest/generated/cmdlets/UpdateAzBotService_UpdateViaIdentityExpanded.cs index 106035a350c1..fbc72102bbd8 100644 --- a/generated/BotService/BotService.Autorest/generated/cmdlets/UpdateAzBotService_UpdateViaIdentityExpanded.cs +++ b/generated/BotService/BotService.Autorest/generated/cmdlets/UpdateAzBotService_UpdateViaIdentityExpanded.cs @@ -6,19 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Cmdlets; using System; - /// Updates a Bot Service + /// update a Bot Service /// /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzBotService_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot))] - [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Description(@"Updates a Bot Service")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot))] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Description(@"update a Bot Service")] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}", ApiVersion = "2022-06-15-preview")] public partial class UpdateAzBotService_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,8 +37,20 @@ public partial class UpdateAzBotService_UpdateViaIdentityExpanded : 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; + /// Bot resource definition - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Bot(); + private Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Bot(); + + /// + /// 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; /// Contains resource all settings defined as key/value pairs. [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ExportAs(typeof(global::System.Collections.Hashtable))] @@ -46,8 +61,8 @@ public partial class UpdateAzBotService_UpdateViaIdentityExpanded : global::Syst ReadOnly = false, Description = @"Contains resource all settings defined as key/value pairs.", SerializedName = @"allSettings", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesAllSettings) })] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesAllSettings AllSetting { get => _parametersBody.AllSetting ?? null /* object */; set => _parametersBody.AllSetting = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesAllSettings) })] + public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesAllSettings AllSetting { get => _parametersBody.AllSetting ?? null /* object */; set => _parametersBody.AllSetting = value; } /// The hint (e.g. keyVault secret resourceId) on how to fetch the app secret [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The hint (e.g. keyVault secret resourceId) on how to fetch the app secret")] @@ -65,6 +80,9 @@ public partial class UpdateAzBotService_UpdateViaIdentityExpanded : global::Syst [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.BotService Client => Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.ClientAPI; @@ -179,6 +197,9 @@ public partial class UpdateAzBotService_UpdateViaIdentityExpanded : global::Syst PossibleTypes = new [] { typeof(string) })] public string Etag { get => _parametersBody.Etag ?? null; set => _parametersBody.Etag = 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] @@ -243,9 +264,9 @@ public partial class UpdateAzBotService_UpdateViaIdentityExpanded : global::Syst ReadOnly = false, Description = @"Required. Gets or sets the Kind of the resource.", SerializedName = @"kind", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Kind) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Kind))] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Kind Kind { get => _parametersBody.Kind ?? ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Kind)""); set => _parametersBody.Kind = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("sdk", "designer", "bot", "function", "azurebot")] + public string Kind { get => _parametersBody.Kind ?? null; set => _parametersBody.Kind = value; } /// Specifies the location of the resource. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the location of the resource.")] @@ -268,7 +289,7 @@ public partial class UpdateAzBotService_UpdateViaIdentityExpanded : global::Syst Description = @"Collection of LUIS App Ids", SerializedName = @"luisAppIds", PossibleTypes = new [] { typeof(string) })] - public string[] LuisAppId { get => _parametersBody.LuisAppId ?? null /* arrayOf */; set => _parametersBody.LuisAppId = value; } + public string[] LuisAppId { get => _parametersBody.LuisAppId?.ToArray() ?? null /* fixedArrayOf */; set => _parametersBody.LuisAppId = (value != null ? new System.Collections.Generic.List(value) : null); } /// The LUIS Key [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The LUIS Key")] @@ -300,17 +321,6 @@ public partial class UpdateAzBotService_UpdateViaIdentityExpanded : global::Syst /// cancellation token. global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; - /// Microsoft App Id for the bot - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Microsoft App Id for the bot")] - [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Microsoft App Id for the bot", - SerializedName = @"msaAppId", - PossibleTypes = new [] { typeof(string) })] - public string MsaAppId { get => _parametersBody.MsaAppId ?? null; set => _parametersBody.MsaAppId = value; } - /// Microsoft App Managed Identity Resource Id for the bot [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Microsoft App Managed Identity Resource Id for the bot")] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Body)] @@ -322,17 +332,6 @@ public partial class UpdateAzBotService_UpdateViaIdentityExpanded : global::Syst PossibleTypes = new [] { typeof(string) })] public string MsaAppMsiResourceId { get => _parametersBody.MsaAppMsiResourceId ?? null; set => _parametersBody.MsaAppMsiResourceId = value; } - /// Microsoft App Tenant Id for the bot - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Microsoft App Tenant Id for the bot")] - [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Microsoft App Tenant Id for the bot", - SerializedName = @"msaAppTenantId", - PossibleTypes = new [] { typeof(string) })] - public string MsaAppTenantId { get => _parametersBody.MsaAppTenantId ?? null; set => _parametersBody.MsaAppTenantId = value; } - /// Microsoft App Type for the bot [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Microsoft App Type for the bot")] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Body)] @@ -341,9 +340,9 @@ public partial class UpdateAzBotService_UpdateViaIdentityExpanded : global::Syst ReadOnly = false, Description = @"Microsoft App Type for the bot", SerializedName = @"msaAppType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.MsaAppType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.MsaAppType))] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.MsaAppType MsaAppType { get => _parametersBody.MsaAppType ?? ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.MsaAppType)""); set => _parametersBody.MsaAppType = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("UserAssignedMSI", "SingleTenant", "MultiTenant")] + public string MsaAppType { get => _parametersBody.MsaAppType ?? null; set => _parametersBody.MsaAppType = value; } /// /// The hint to browser (e.g. protocol handler) on how to open the bot for authoring @@ -367,13 +366,13 @@ public partial class UpdateAzBotService_UpdateViaIdentityExpanded : global::Syst ReadOnly = false, Description = @"Contains resource parameters defined as key/value pairs.", SerializedName = @"parameters", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesParameters) })] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesParameters Parameter { get => _parametersBody.Parameter ?? null /* object */; set => _parametersBody.Parameter = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesParameters) })] + public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesParameters Parameter { get => _parametersBody.Parameter ?? null /* object */; set => _parametersBody.Parameter = value; } /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.BotService.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")] @@ -399,9 +398,9 @@ public partial class UpdateAzBotService_UpdateViaIdentityExpanded : global::Syst ReadOnly = false, Description = @"Whether the bot is in an isolated network", SerializedName = @"publicNetworkAccess", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PublicNetworkAccess) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PublicNetworkAccess))] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PublicNetworkAccess PublicNetworkAccess { get => _parametersBody.PublicNetworkAccess ?? ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PublicNetworkAccess)""); set => _parametersBody.PublicNetworkAccess = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("Enabled", "Disabled")] + public string PublicNetworkAccess { get => _parametersBody.PublicNetworkAccess ?? null; set => _parametersBody.PublicNetworkAccess = value; } /// Publishing credentials of the resource [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Publishing credentials of the resource")] @@ -433,9 +432,9 @@ public partial class UpdateAzBotService_UpdateViaIdentityExpanded : global::Syst ReadOnly = false, Description = @"The sku name", SerializedName = @"name", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName))] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName SkuName { get => _parametersBody.SkuName ?? ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName)""); set => _parametersBody.SkuName = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("F0", "S1")] + public string SkuName { get => _parametersBody.SkuName ?? null; set => _parametersBody.SkuName = value; } /// The storage resourceId for the bot [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The storage resourceId for the bot")] @@ -457,55 +456,44 @@ public partial class UpdateAzBotService_UpdateViaIdentityExpanded : global::Syst ReadOnly = false, Description = @"Contains resource tags defined as key/value pairs.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceTags Tag { get => _parametersBody.Tag ?? null /* object */; set => _parametersBody.Tag = value; } - - /// The Tenant Id for the bot - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The Tenant Id for the bot")] - [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The Tenant Id for the bot", - SerializedName = @"tenantId", - PossibleTypes = new [] { typeof(string) })] - public string TenantId { get => _parametersBody.TenantId ?? null; set => _parametersBody.TenantId = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceTags Tag { get => _parametersBody.Tag ?? null /* object */; set => _parametersBody.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.BotService.Models.Api20220615Preview.IBot + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot /// 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.BotService.Models.Api20220615Preview.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IError /// 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.BotService.Models.Api20220615Preview.IBot + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot /// 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) @@ -528,6 +516,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.BotService.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -592,8 +585,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.BotService.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.BotService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -649,7 +667,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -664,11 +682,15 @@ protected override void ProcessRecord() await ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } if (InputObject?.Id != null) { - await this.Client.BotsUpdateViaIdentity(InputObject.Id, _parametersBody, onOk, onCreated, onDefault, this, Pipeline); + await this.Client.BotsUpdateViaIdentity(InputObject.Id, _parametersBody, onOk, onCreated, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeUpdate); } else { // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } if (null == InputObject.ResourceGroupName) { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); @@ -677,17 +699,13 @@ protected override void ProcessRecord() { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceName"),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.BotsUpdate(InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, InputObject.SubscriptionId ?? null, _parametersBody, onOk, onCreated, onDefault, this, Pipeline); + await this.Client.BotsUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, _parametersBody, onOk, onCreated, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SerializationMode.IncludeUpdate); } await ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.BotService.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 } }); @@ -707,7 +725,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzBotService_UpdateViaIdentityExpanded() { @@ -731,12 +749,12 @@ public UpdateAzBotService_UpdateViaIdentityExpanded() /// 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.BotService.Models.Api20220615Preview.IBot + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot /// 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 ) { @@ -748,8 +766,26 @@ public UpdateAzBotService_UpdateViaIdentityExpanded() return ; } // onCreated - response for 201 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot + 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; + } + } } } @@ -757,12 +793,12 @@ public UpdateAzBotService_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.BotService.Models.Api20220615Preview.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IError /// 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 ) { @@ -779,15 +815,15 @@ public UpdateAzBotService_UpdateViaIdentityExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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 } }); @@ -797,12 +833,12 @@ public UpdateAzBotService_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.BotService.Models.Api20220615Preview.IBot + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot /// 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 ) { @@ -814,8 +850,26 @@ public UpdateAzBotService_UpdateViaIdentityExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot + 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/BotService/BotService.Autorest/generated/cmdlets/UpdateAzBotService_UpdateViaJsonFilePath.cs b/generated/BotService/BotService.Autorest/generated/cmdlets/UpdateAzBotService_UpdateViaJsonFilePath.cs new file mode 100644 index 000000000000..39ad1ecf1cd8 --- /dev/null +++ b/generated/BotService/BotService.Autorest/generated/cmdlets/UpdateAzBotService_UpdateViaJsonFilePath.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.BotService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Cmdlets; + using System; + + /// update a Bot Service + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzBotService_UpdateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot))] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Description(@"update a Bot Service")] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}", ApiVersion = "2022-06-15-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.NotSuggestDefaultParameterSet] + public partial class UpdateAzBotService_UpdateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.BotService Client => Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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.BotService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the Bot resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Bot resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Bot resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("BotName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the Bot resource group in the user subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Bot resource group in the user subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Bot resource group in the user subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// Azure Subscription ID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Azure Subscription ID.")] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Azure Subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.IBot + /// 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.BotService.Models.IError + /// 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.BotService.Models.IBot + /// 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.BotService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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.BotService.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.BotService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.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.BotService.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BotsUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BotsUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, onOk, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzBotService_UpdateViaJsonFilePath() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.IBot + /// 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.BotService.Models.IBot + 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.BotService.Models.IError + /// 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.BotService.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.BotService.Models.IBot + /// 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.BotService.Models.IBot + 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/BotService/BotService.Autorest/generated/cmdlets/RemoveAzBotServicePrivateEndpointConnection_Delete.cs b/generated/BotService/BotService.Autorest/generated/cmdlets/UpdateAzBotService_UpdateViaJsonString.cs similarity index 74% rename from generated/BotService/BotService.Autorest/generated/cmdlets/RemoveAzBotServicePrivateEndpointConnection_Delete.cs rename to generated/BotService/BotService.Autorest/generated/cmdlets/UpdateAzBotService_UpdateViaJsonString.cs index b80f8a19da4d..563eec034068 100644 --- a/generated/BotService/BotService.Autorest/generated/cmdlets/RemoveAzBotServicePrivateEndpointConnection_Delete.cs +++ b/generated/BotService/BotService.Autorest/generated/cmdlets/UpdateAzBotService_UpdateViaJsonString.cs @@ -6,20 +6,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Cmdlets; using System; - /// Deletes the specified private endpoint connection associated with the Bot. + /// update a Bot Service /// - /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}" + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}" /// - [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.InternalExport] - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzBotServicePrivateEndpointConnection_Delete", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(bool))] - [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Description(@"Deletes the specified private endpoint connection associated with the Bot.")] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzBotService_UpdateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot))] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Description(@"update a Bot Service")] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", ApiVersion = "2022-06-15-preview")] - public partial class RemoveAzBotServicePrivateEndpointConnection_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}", ApiVersion = "2022-06-15-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.NotSuggestDefaultParameterSet] + public partial class UpdateAzBotService_UpdateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.BotService.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 RemoveAzBotServicePrivateEndpointConnection_Delete : 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.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.BotService Client => Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.ClientAPI; @@ -53,6 +71,9 @@ public partial class RemoveAzBotServicePrivateEndpointConnection_Delete : global [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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] @@ -68,6 +89,19 @@ public partial class RemoveAzBotServicePrivateEndpointConnection_Delete : global /// 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.BotService.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. /// @@ -79,29 +113,22 @@ public partial class RemoveAzBotServicePrivateEndpointConnection_Delete : global /// Backing field for property. private string _name; - /// The name of the private endpoint connection associated with the Azure resource - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the private endpoint connection associated with the Azure resource")] + /// The name of the Bot resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Bot resource.")] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( Required = true, ReadOnly = false, - Description = @"The name of the private endpoint connection associated with the Azure resource", - SerializedName = @"privateEndpointConnectionName", + Description = @"The name of the Bot resource.", + SerializedName = @"resourceName", PossibleTypes = new [] { typeof(string) })] - [global::System.Management.Automation.Alias("PrivateEndpointConnectionName")] + [global::System.Management.Automation.Alias("BotName")] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Path)] public string Name { get => this._name; set => this._name = value; } - /// - /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] - [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter PassThru { get; set; } - /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.BotService.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")] @@ -133,20 +160,6 @@ public partial class RemoveAzBotServicePrivateEndpointConnection_Delete : global [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Path)] public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } - /// Backing field for property. - private string _resourceName; - - /// The name of the Bot resource. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Bot resource.")] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the Bot resource.", - SerializedName = @"resourceName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.ParameterCategory.Path)] - public string ResourceName { get => this._resourceName; set => this._resourceName = value; } - /// Backing field for property. private string _subscriptionId; @@ -161,41 +174,46 @@ public partial class RemoveAzBotServicePrivateEndpointConnection_Delete : global [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.BotService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BotService.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 + /// 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.BotService.Models.Api20220615Preview.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot /// from the remote call - /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// /// 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 overrideOnDefault(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); /// - /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of - /// what happens on that response. Implement this method in a partial class to enable this behavior + /// 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. - /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IError + /// 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 overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, 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.BotService.Models.IBot + /// 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, 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) @@ -218,6 +236,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.BotService.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -282,8 +305,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.BotService.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.BotService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -300,7 +348,7 @@ protected override void ProcessRecord() try { // work - if (ShouldProcess($"Call remote 'PrivateEndpointConnectionsDelete' operation")) + if (ShouldProcess($"Call remote 'BotsUpdate' operation")) { using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token) ) { @@ -339,7 +387,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BotService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -352,12 +400,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.PrivateEndpointConnectionsDelete(ResourceGroupName, ResourceName, SubscriptionId, Name, onOk, onNoContent, onDefault, this, Pipeline); + await this.Client.BotsUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, onOk, onCreated, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,ResourceName=ResourceName,SubscriptionId=SubscriptionId,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 } }); @@ -369,14 +417,6 @@ protected override void ProcessRecord() } } - /// - /// Intializes a new instance of the cmdlet class. - /// - public RemoveAzBotServicePrivateEndpointConnection_Delete() - { - - } - /// Interrupts currently running code within the command. protected override void StopProcessing() { @@ -384,6 +424,14 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzBotService_UpdateViaJsonString() + { + + } + /// new protected void WriteObject(object sendToPipeline) { @@ -399,92 +447,128 @@ protected override void StopProcessing() base.WriteObject(sendToPipeline, enumerateCollection); } - /// - /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). - /// + /// 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.BotService.Models.Api20220615Preview.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot /// 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 onCreated(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. + overrideOnCreated(responseMessage, response, ref _returnNow); + // if overrideOnCreated 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)) + // onCreated - response for 201 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot + var result = (await response); + if (null != result) { - // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, ResourceName=ResourceName, SubscriptionId=SubscriptionId, Name=Name }) + if (0 == _responseSize) { - 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, ResourceName=ResourceName, SubscriptionId=SubscriptionId, Name=Name }) + _firstResponse = result; + _responseSize = 1; + } + else { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } - }); + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } } } } - /// 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). + /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IError + /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + 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); - overrideOnNoContent(responseMessage, ref _returnNow); - // if overrideOnNoContent has returned true, then return right away. + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. if ((null != _returnNow && await _returnNow)) { return ; } - // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) { - WriteObject(true); + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Models.IBot + /// 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) + 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, ref _returnNow); + overrideOnOk(responseMessage, response, ref _returnNow); // if overrideOnOk has returned true, then return right away. if ((null != _returnNow && await _returnNow)) { return ; } - // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot + var result = (await response); + if (null != result) { - WriteObject(true); + 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/BotService/BotService.Autorest/generated/runtime/Attributes/ExternalDocsAttribute.cs b/generated/BotService/BotService.Autorest/generated/runtime/Attributes/ExternalDocsAttribute.cs new file mode 100644 index 000000000000..761136ffca1c --- /dev/null +++ b/generated/BotService/BotService.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.BotService +{ + 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/BotService/BotService.Autorest/generated/runtime/Attributes/PSArgumentCompleterAttribute.cs b/generated/BotService/BotService.Autorest/generated/runtime/Attributes/PSArgumentCompleterAttribute.cs new file mode 100644 index 000000000000..2dc09663774a --- /dev/null +++ b/generated/BotService/BotService.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.BotService +{ + 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/BotService/BotService.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs b/generated/BotService/BotService.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs index 8bce8c3dd2f7..b1d086b8baf7 100644 --- a/generated/BotService/BotService.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs +++ b/generated/BotService/BotService.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.BotService.Models"; - private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.BotService.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/BotService/BotService.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs b/generated/BotService/BotService.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs index 2243d4c61e6f..fb36b199058a 100644 --- a/generated/BotService/BotService.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs +++ b/generated/BotService/BotService.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.BotService.Models"; - private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.BotService.Support"; + private const string SupportNamespace = @"${$project.supportNamespace.fullName}"; protected override void ProcessRecord() { diff --git a/generated/BotService/BotService.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs b/generated/BotService/BotService.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs index 9794ed3990ef..d26642c9370c 100644 --- a/generated/BotService/BotService.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs +++ b/generated/BotService/BotService.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/BotService/BotService.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs b/generated/BotService/BotService.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs index da1987ea47b7..ad60cba51697 100644 --- a/generated/BotService/BotService.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs +++ b/generated/BotService/BotService.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/BotService/BotService.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs b/generated/BotService/BotService.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs index 1285df73e695..b1df16c06c99 100644 --- a/generated/BotService/BotService.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs +++ b/generated/BotService/BotService.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs @@ -12,50 +12,96 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.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/BotService/BotService.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs b/generated/BotService/BotService.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs index e58ec6574be2..b6796ef1b6b6 100644 --- a/generated/BotService/BotService.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs +++ b/generated/BotService/BotService.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/BotService/BotService.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs b/generated/BotService/BotService.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs index 87d4ccd395ad..106909e719e8 100644 --- a/generated/BotService/BotService.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs +++ b/generated/BotService/BotService.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/BotService/BotService.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs b/generated/BotService/BotService.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs index d0e08d4f3681..b94203fa9d56 100644 --- a/generated/BotService/BotService.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs +++ b/generated/BotService/BotService.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.BotService.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.BotService.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.BotService.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/BotService/BotService.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs b/generated/BotService/BotService.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs index b9afc79de35d..37b99c47ca38 100644 --- a/generated/BotService/BotService.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs +++ b/generated/BotService/BotService.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs @@ -31,7 +31,7 @@ internal class VariantGroup { public string ModuleName { get; } - public string RootModuleName {get => @"";} + public string RootModuleName { get => @""; } public string CmdletName { get; } public string CmdletVerb { get; } public string CmdletNoun { get; } @@ -49,7 +49,7 @@ internal class VariantGroup public PsHelpInfo HelpInfo { get; } public bool IsGenerated { get; } public bool IsInternal { get; } - + public bool IsModelCmdlet { get; } public string OutputFolder { get; } public string FileName { get; } public string FilePath { get; } @@ -84,7 +84,7 @@ public VariantGroup(string moduleName, string cmdletName, Variant[] variants, st HelpInfo = Variants.Select(v => v.HelpInfo).FirstOrDefault() ?? new PsHelpInfo(); IsGenerated = Variants.All(v => v.Attributes.OfType().Any()); IsInternal = isInternal; - + IsModelCmdlet = Variants.All(v => v.IsModelCmdlet); OutputFolder = outputFolder; FileName = $"{CmdletName}{(isTest ? ".Tests" : String.Empty)}.ps1"; FilePath = Path.Combine(OutputFolder, FileName); @@ -101,12 +101,23 @@ private string DetermineDefaultParameterSetName() if (String.IsNullOrEmpty(defaultParameterSet)) { var variantParamCountGroups = Variants + .Where(v => !v.IsNotSuggestDefaultParameterSet) .Select(v => ( variant: v.VariantName, paramCount: v.CmdletOnlyParameters.Count(p => p.IsMandatory), isSimple: v.CmdletOnlyParameters.Where(p => p.IsMandatory).All(p => p.ParameterType.IsPsSimple()))) .GroupBy(vpc => vpc.isSimple) .ToArray(); + if (variantParamCountGroups.Length == 0) + { + variantParamCountGroups = Variants + .Select(v => ( + variant: v.VariantName, + paramCount: v.CmdletOnlyParameters.Count(p => p.IsMandatory), + isSimple: v.CmdletOnlyParameters.Where(p => p.IsMandatory).All(p => p.ParameterType.IsPsSimple()))) + .GroupBy(vpc => vpc.isSimple) + .ToArray(); + } var variantParameterCounts = (variantParamCountGroups.Any(g => g.Key) ? variantParamCountGroups.Where(g => g.Key) : variantParamCountGroups).SelectMany(g => g).ToArray(); var smallestParameterCount = variantParameterCounts.Min(vpc => vpc.paramCount); defaultParameterSet = variantParameterCounts.First(vpc => vpc.paramCount == smallestParameterCount).variant; @@ -134,7 +145,9 @@ internal class Variant public Parameter[] Parameters { get; } public Parameter[] CmdletOnlyParameters { get; } public bool IsInternal { get; } + public bool IsModelCmdlet { get; } public bool IsDoNotExport { get; } + public bool IsNotSuggestDefaultParameterSet { get; } public string[] Profiles { get; } public Variant(string cmdletName, string variantName, CommandInfo info, CommandMetadata metadata, bool hasParameterSets = false, PsHelpInfo helpInfo = null) @@ -155,6 +168,8 @@ public Variant(string cmdletName, string variantName, CommandInfo info, CommandM Parameters = this.ToParameters().OrderBy(p => p.OrderCategory).ThenByDescending(p => p.IsMandatory).ToArray(); IsInternal = Attributes.OfType().Any(); IsDoNotExport = Attributes.OfType().Any(); + IsModelCmdlet = Attributes.OfType().Any(); + IsNotSuggestDefaultParameterSet = Attributes.OfType().Any(); CmdletOnlyParameters = Parameters.Where(p => !p.Categories.Any(c => c == ParameterCategory.Azure || c == ParameterCategory.Runtime)).ToArray(); Profiles = Attributes.OfType().SelectMany(pa => pa.Profiles).ToArray(); } @@ -210,6 +225,7 @@ public ParameterGroup(string parameterName, Parameter[] parameters, string[] all HasValidateNotNull = Parameters.SelectMany(p => p.Attributes.OfType()).Any(); HasAllowEmptyArray = Parameters.SelectMany(p => p.Attributes.OfType()).Any(); CompleterInfo = Parameters.Select(p => p.CompleterInfoAttribute).FirstOrDefault()?.ToCompleterInfo() + ?? Parameters.Select(p => p.PSArgumentCompleterAttribute).FirstOrDefault()?.ToPSArgumentCompleterInfo() ?? Parameters.Select(p => p.ArgumentCompleterAttribute).FirstOrDefault()?.ToCompleterInfo(); DefaultInfo = Parameters.Select(p => p.DefaultInfoAttribute).FirstOrDefault()?.ToDefaultInfo(this) ?? Parameters.Select(p => p.DefaultValueAttribute).FirstOrDefault(dv => dv != null)?.ToDefaultInfo(this); @@ -244,7 +260,6 @@ internal class Parameter public ParameterMetadata Metadata { get; } public PsParameterHelpInfo HelpInfo { get; } public Type ParameterType { get; } - public Attribute[] Attributes { get; } public ParameterCategory[] Categories { get; } public ParameterCategory OrderCategory { get; } @@ -254,6 +269,7 @@ internal class Parameter public bool SupportsWildcards { get; } public CompleterInfoAttribute CompleterInfoAttribute { get; } public ArgumentCompleterAttribute ArgumentCompleterAttribute { get; } + public PSArgumentCompleterAttribute PSArgumentCompleterAttribute { get; } public bool ValueFromPipeline { get; } public bool ValueFromPipelineByPropertyName { get; } @@ -286,7 +302,8 @@ public Parameter(string variantName, string parameterName, ParameterMetadata met } SupportsWildcards = Attributes.OfType().Any(); CompleterInfoAttribute = Attributes.OfType().FirstOrDefault(); - ArgumentCompleterAttribute = Attributes.OfType().FirstOrDefault(); + PSArgumentCompleterAttribute = Attributes.OfType().FirstOrDefault(); + ArgumentCompleterAttribute = Attributes.OfType().FirstOrDefault(attr => !attr.GetType().Equals(typeof(PSArgumentCompleterAttribute))); ValueFromPipeline = ParameterAttribute.ValueFromPipeline; ValueFromPipelineByPropertyName = ParameterAttribute.ValueFromPipelineByPropertyName; @@ -295,10 +312,10 @@ public Parameter(string variantName, string parameterName, ParameterMetadata met IsMandatory = ParameterAttribute.Mandatory; var complexParameterName = ParameterName.ToUpperInvariant(); - var complexMessage = $"{Environment.NewLine}To construct, see NOTES section for {complexParameterName} properties and create a hash table."; + var complexMessage = $"{Environment.NewLine}"; var description = ParameterAttribute.HelpMessage.NullIfEmpty() ?? HelpInfo.Description.NullIfEmpty() ?? InfoAttribute?.Description.NullIfEmpty() ?? String.Empty; // Remove the complex type message as it will be reinserted if this is a complex type - description = description.NormalizeNewLines().Replace(complexMessage, String.Empty).Replace(complexMessage.ToPsSingleLine(), String.Empty); + description = description.NormalizeNewLines(); // Make an InfoAttribute for processing only if one isn't provided InfoAttribute = Attributes.OfType().FirstOrDefault() ?? new InfoAttribute { PossibleTypes = new[] { ParameterType.Unwrap() }, Required = IsMandatory }; // Set the description if the InfoAttribute does not have one since they are exported without a description @@ -318,7 +335,7 @@ internal class ComplexInterfaceInfo public bool Required { get; } public bool ReadOnly { get; } public string Description { get; } - + public ComplexInterfaceInfo[] NestedInfos { get; } public bool IsComplexInterface { get; } @@ -335,7 +352,7 @@ public ComplexInterfaceInfo(string name, Type type, InfoAttribute infoAttribute, var unwrappedType = Type.Unwrap(); var hasBeenSeen = seenTypes?.Contains(unwrappedType) ?? false; (seenTypes ?? (seenTypes = new List())).Add(unwrappedType); - NestedInfos = hasBeenSeen ? new ComplexInterfaceInfo[]{} : + NestedInfos = hasBeenSeen ? new ComplexInterfaceInfo[] { } : unwrappedType.GetInterfaces() .Concat(InfoAttribute.PossibleTypes) .SelectMany(pt => pt.GetProperties() @@ -366,6 +383,7 @@ internal class CommentInfo public string OnlineVersion { get; } public string[] RelatedLinks { get; } + public string[] ExternalUrls { get; } private const string HelpLinkPrefix = @"https://learn.microsoft.com/powershell/module/"; @@ -391,6 +409,9 @@ public CommentInfo(VariantGroup variantGroup) var moduleName = variantGroup.RootModuleName == "" ? variantGroup.ModuleName.ToLowerInvariant() : variantGroup.RootModuleName.ToLowerInvariant(); OnlineVersion = helpInfo.OnlineVersion?.Uri.NullIfEmpty() ?? $@"{HelpLinkPrefix}{moduleName}/{variantGroup.CmdletName.ToLowerInvariant()}"; RelatedLinks = helpInfo.RelatedLinks.Select(rl => rl.Text).ToArray(); + + // Get external urls from attribute + ExternalUrls = variantGroup.Variants.SelectMany(v => v.Attributes).OfType()?.Select(e => e.Url)?.Distinct()?.ToArray(); } } @@ -420,11 +441,22 @@ public CompleterInfo(ArgumentCompleterAttribute completerAttribute) } } + internal class PSArgumentCompleterInfo : CompleterInfo + { + public string[] ResourceTypes { get; } + + public PSArgumentCompleterInfo(PSArgumentCompleterAttribute completerAttribute) : base(completerAttribute) + { + ResourceTypes = completerAttribute.ResourceTypes; + } + } + internal class DefaultInfo { public string Name { get; } public string Description { get; } public string Script { get; } + public string SetCondition { get; } public ParameterGroup ParameterGroup { get; } public DefaultInfo(DefaultInfoAttribute infoAttribute, ParameterGroup parameterGroup) @@ -432,6 +464,7 @@ public DefaultInfo(DefaultInfoAttribute infoAttribute, ParameterGroup parameterG Name = infoAttribute.Name; Description = infoAttribute.Description; Script = infoAttribute.Script; + SetCondition = infoAttribute.SetCondition; ParameterGroup = parameterGroup; } @@ -479,7 +512,8 @@ public static Parameter[] ToParameters(this Variant variant) parameterHelp = parameterHelp.Where(ph => (!ph.ParameterSetNames.Any() || ph.ParameterSetNames.Any(psn => psn == variant.VariantName || psn == AllParameterSets)) && ph.Name != "IncludeTotalCount"); } var result = parameters.Select(p => new Parameter(variant.VariantName, p.Key, p.Value, parameterHelp.FirstOrDefault(ph => ph.Name == p.Key))); - if (variant.SupportsPaging) { + if (variant.SupportsPaging) + { // If supportsPaging is set, we will need to add First and Skip parameters since they are treated as common parameters which as not contained on Metadata>parameters variant.Info.Parameters["First"].Attributes.OfType().FirstOrDefault(pa => pa.ParameterSetName == variant.VariantName || pa.ParameterSetName == AllParameterSets).HelpMessage = "Gets only the first 'n' objects."; variant.Info.Parameters["Skip"].Attributes.OfType().FirstOrDefault(pa => pa.ParameterSetName == variant.VariantName || pa.ParameterSetName == AllParameterSets).HelpMessage = "Ignores the first 'n' objects and then gets the remaining objects."; @@ -507,7 +541,7 @@ public static ComplexInterfaceInfo ToComplexInterfaceInfo(this InfoAttribute inf public static CompleterInfo ToCompleterInfo(this CompleterInfoAttribute infoAttribute) => new CompleterInfo(infoAttribute); public static CompleterInfo ToCompleterInfo(this ArgumentCompleterAttribute completerAttribute) => new CompleterInfo(completerAttribute); - + public static PSArgumentCompleterInfo ToPSArgumentCompleterInfo(this PSArgumentCompleterAttribute completerAttribute) => new PSArgumentCompleterInfo(completerAttribute); public static DefaultInfo ToDefaultInfo(this DefaultInfoAttribute infoAttribute, ParameterGroup parameterGroup) => new DefaultInfo(infoAttribute, parameterGroup); public static DefaultInfo ToDefaultInfo(this PSDefaultValueAttribute defaultValueAttribute, ParameterGroup parameterGroup) => new DefaultInfo(defaultValueAttribute, parameterGroup); } diff --git a/generated/BotService/BotService.Autorest/generated/runtime/BuildTime/PsAttributes.cs b/generated/BotService/BotService.Autorest/generated/runtime/BuildTime/PsAttributes.cs index 5f49b3464e22..ed4a46a50d35 100644 --- a/generated/BotService/BotService.Autorest/generated/runtime/BuildTime/PsAttributes.cs +++ b/generated/BotService/BotService.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/BotService/BotService.Autorest/generated/runtime/BuildTime/PsExtensions.cs b/generated/BotService/BotService.Autorest/generated/runtime/BuildTime/PsExtensions.cs index 985d97b6f357..6c5579744159 100644 --- a/generated/BotService/BotService.Autorest/generated/runtime/BuildTime/PsExtensions.cs +++ b/generated/BotService/BotService.Autorest/generated/runtime/BuildTime/PsExtensions.cs @@ -13,6 +13,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PowerShell { internal static class PsExtensions { + public static PSObject AddMultipleTypeNameIntoPSObject(this object obj, string multipleTag = "#Multiple") + { + var psObj = new PSObject(obj); + psObj.TypeNames.Insert(0, $"{psObj.TypeNames[0]}{multipleTag}"); + return psObj; + } + // https://stackoverflow.com/a/863944/294804 // https://stackoverflow.com/a/4452598/294804 // https://stackoverflow.com/a/28701974/294804 diff --git a/generated/BotService/BotService.Autorest/generated/runtime/BuildTime/PsHelpers.cs b/generated/BotService/BotService.Autorest/generated/runtime/BuildTime/PsHelpers.cs index 1ef4eb47de2b..221c359cb1ea 100644 --- a/generated/BotService/BotService.Autorest/generated/runtime/BuildTime/PsHelpers.cs +++ b/generated/BotService/BotService.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/BotService/BotService.Autorest/generated/runtime/Context.cs b/generated/BotService/BotService.Autorest/generated/runtime/Context.cs new file mode 100644 index 000000000000..6c9506189096 --- /dev/null +++ b/generated/BotService/BotService.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.BotService.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.BotService.Runtime.Extensions; + + /// + /// The IContext Interface defines the communication mechanism for input customization. + /// + /// + /// In the context, we will have client, pipeline, PSBoundParamters, default EventListener, Cancellation. + /// + public interface IContext + { + System.Management.Automation.InvocationInfo InvocationInformation { get; set; } + System.Threading.CancellationTokenSource CancellationTokenSource { get; set; } + System.Collections.Generic.IDictionary ExtensibleParameters { get; } + HttpPipeline Pipeline { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.BotService.BotService Client { get; } + } +} diff --git a/generated/BotService/BotService.Autorest/generated/runtime/Events.cs b/generated/BotService/BotService.Autorest/generated/runtime/Events.cs index 28a6587d35a1..4998702ed9a7 100644 --- a/generated/BotService/BotService.Autorest/generated/runtime/Events.cs +++ b/generated/BotService/BotService.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/BotService/BotService.Autorest/generated/runtime/ISendAsync.cs b/generated/BotService/BotService.Autorest/generated/runtime/ISendAsync.cs index 94773616594c..06ee8a26fe3d 100644 --- a/generated/BotService/BotService.Autorest/generated/runtime/ISendAsync.cs +++ b/generated/BotService/BotService.Autorest/generated/runtime/ISendAsync.cs @@ -11,6 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.BotService.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/BotService/BotService.Autorest/generated/runtime/InfoAttribute.cs b/generated/BotService/BotService.Autorest/generated/runtime/InfoAttribute.cs index 14a864efc302..2b62c33c5297 100644 --- a/generated/BotService/BotService.Autorest/generated/runtime/InfoAttribute.cs +++ b/generated/BotService/BotService.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/BotService/BotService.Autorest/generated/runtime/InputHandler.cs b/generated/BotService/BotService.Autorest/generated/runtime/InputHandler.cs new file mode 100644 index 000000000000..6e349252e837 --- /dev/null +++ b/generated/BotService/BotService.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.BotService.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.BotService.Runtime.IContext context); + } +} \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs b/generated/BotService/BotService.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs index c5e95cff741a..6e2595abe005 100644 --- a/generated/BotService/BotService.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs +++ b/generated/BotService/BotService.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/BotService/BotService.Autorest/generated/runtime/SerializationMode.cs b/generated/BotService/BotService.Autorest/generated/runtime/SerializationMode.cs index 4ebcac383259..fe3e03e782e1 100644 --- a/generated/BotService/BotService.Autorest/generated/runtime/SerializationMode.cs +++ b/generated/BotService/BotService.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/BotService/BotService.Autorest/generated/runtime/TypeConverterExtensions.cs b/generated/BotService/BotService.Autorest/generated/runtime/TypeConverterExtensions.cs index 5353bff9c6a4..21428f20c272 100644 --- a/generated/BotService/BotService.Autorest/generated/runtime/TypeConverterExtensions.cs +++ b/generated/BotService/BotService.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/BotService/BotService.Autorest/internal/Get-AzBotServiceCheckNameAvailability.ps1 b/generated/BotService/BotService.Autorest/internal/Get-AzBotServiceCheckNameAvailability.ps1 index 1d1b600098d0..aeb4e4e4ed27 100644 --- a/generated/BotService/BotService.Autorest/internal/Get-AzBotServiceCheckNameAvailability.ps1 +++ b/generated/BotService/BotService.Autorest/internal/Get-AzBotServiceCheckNameAvailability.ps1 @@ -25,9 +25,9 @@ Check whether a bot name is available. {{ Add code here }} .Inputs -Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICheckNameAvailabilityRequestBody +Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityRequestBody .Outputs -Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICheckNameAvailabilityResponseBody +Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityResponseBody .Notes COMPLEX PARAMETER PROPERTIES @@ -40,14 +40,13 @@ PARAMETER : The request body for a request to https://learn.microsoft.com/powershell/module/az.botservice/get-azbotservicechecknameavailability #> function Get-AzBotServiceCheckNameAvailability { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICheckNameAvailabilityResponseBody])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityResponseBody])] [CmdletBinding(DefaultParameterSetName='GetExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Get', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICheckNameAvailabilityRequestBody] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityRequestBody] # The request body for a request to Bot Service Management to check availability of a bot name. - # To construct, see NOTES section for PARAMETER properties and create a hash table. ${Parameter}, [Parameter(ParameterSetName='GetExpanded')] @@ -62,6 +61,18 @@ param( # the type of the bot for which availability needs to be checked ${Type}, + [Parameter(ParameterSetName='GetViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] + [System.String] + # Path of Json file supplied to the Get operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='GetViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] + [System.String] + # Json string supplied to the Get operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -118,13 +129,21 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ Get = 'Az.BotService.private\Get-AzBotServiceCheckNameAvailability_Get'; GetExpanded = 'Az.BotService.private\Get-AzBotServiceCheckNameAvailability_GetExpanded'; + GetViaJsonFilePath = 'Az.BotService.private\Get-AzBotServiceCheckNameAvailability_GetViaJsonFilePath'; + GetViaJsonString = 'Az.BotService.private\Get-AzBotServiceCheckNameAvailability_GetViaJsonString'; } $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/BotService/BotService.Autorest/internal/Get-AzBotServiceHostSetting.ps1 b/generated/BotService/BotService.Autorest/internal/Get-AzBotServiceHostSetting.ps1 deleted file mode 100644 index 7b0ccb878979..000000000000 --- a/generated/BotService/BotService.Autorest/internal/Get-AzBotServiceHostSetting.ps1 +++ /dev/null @@ -1,145 +0,0 @@ - -# ---------------------------------------------------------------------------------- -# 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 -Get per subscription settings needed to host bot in compute resource such as Azure App Service -.Description -Get per subscription settings needed to host bot in compute resource such as Azure App Service -.Example -Get-AzBotServiceHostSetting - -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentity -.Outputs -Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IHostSettingsResponse -.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 - [ChannelName ]: The name of the Channel resource. - [ConnectionName ]: The name of the Bot Service Connection Setting resource. - [Id ]: Resource identity path - [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource - [ResourceGroupName ]: The name of the Bot resource group in the user subscription. - [ResourceName ]: The name of the Bot resource. - [SubscriptionId ]: Azure Subscription ID. -.Link -https://learn.microsoft.com/powershell/module/az.botservice/get-azbotservicehostsetting -#> -function Get-AzBotServiceHostSetting { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IHostSettingsResponse])] -[CmdletBinding(DefaultParameterSetName='GetViaIdentity', PositionalBinding=$false)] -param( - [Parameter(Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentity] - # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. - ${InputObject}, - - [Parameter()] - [Alias('AzureRMContext', 'AzureCredential')] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Wait for .NET debugger to attach - ${Break}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be appended to the front of the pipeline - ${HttpPipelineAppend}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be prepended to the front of the pipeline - ${HttpPipelinePrepend}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')] - [System.Uri] - # The URI for the proxy server to use - ${Proxy}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')] - [System.Management.Automation.PSCredential] - # Credentials for a proxy server to use for the remote call - ${ProxyCredential}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.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 - - $mapping = @{ - GetViaIdentity = 'Az.BotService.private\Get-AzBotServiceHostSetting_GetViaIdentity'; - } - - $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) - $scriptCmd = {& $wrappedCmd @PSBoundParameters} - $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) - $steppablePipeline.Begin($PSCmdlet) - } catch { - - throw - } -} - -process { - try { - $steppablePipeline.Process($_) - } catch { - - throw - } - -} -end { - try { - $steppablePipeline.End() - - } catch { - - throw - } -} -} diff --git a/generated/BotService/BotService.Autorest/internal/Get-AzBotServiceOperation.ps1 b/generated/BotService/BotService.Autorest/internal/Get-AzBotServiceOperation.ps1 index b4c1464e3181..42994abb21bb 100644 --- a/generated/BotService/BotService.Autorest/internal/Get-AzBotServiceOperation.ps1 +++ b/generated/BotService/BotService.Autorest/internal/Get-AzBotServiceOperation.ps1 @@ -25,12 +25,12 @@ Lists all the available BotService operations. {{ Add code here }} .Outputs -Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntity +Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntity .Link https://learn.microsoft.com/powershell/module/az.botservice/get-azbotserviceoperation #> function Get-AzBotServiceOperation { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntity])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntity])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter()] @@ -89,12 +89,18 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ List = 'Az.BotService.private\Get-AzBotServiceOperation_List'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/BotService/BotService.Autorest/internal/Get-AzBotServicePrivateEndpointConnection.ps1 b/generated/BotService/BotService.Autorest/internal/Get-AzBotServicePrivateEndpointConnection.ps1 deleted file mode 100644 index 5461c4a71ac6..000000000000 --- a/generated/BotService/BotService.Autorest/internal/Get-AzBotServicePrivateEndpointConnection.ps1 +++ /dev/null @@ -1,187 +0,0 @@ - -# ---------------------------------------------------------------------------------- -# 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 -Gets the specified private endpoint connection associated with the Bot. -.Description -Gets the specified private endpoint connection associated with the Bot. -.Example -{{ Add code here }} -.Example -{{ Add code here }} - -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentity -.Outputs -Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnection -.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 - [ChannelName ]: The name of the Channel resource. - [ConnectionName ]: The name of the Bot Service Connection Setting resource. - [Id ]: Resource identity path - [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource - [ResourceGroupName ]: The name of the Bot resource group in the user subscription. - [ResourceName ]: The name of the Bot resource. - [SubscriptionId ]: Azure Subscription ID. -.Link -https://learn.microsoft.com/powershell/module/az.botservice/get-azbotserviceprivateendpointconnection -#> -function Get-AzBotServicePrivateEndpointConnection { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnection])] -[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] -param( - [Parameter(ParameterSetName='Get', Mandatory)] - [Alias('PrivateEndpointConnectionName')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')] - [System.String] - # The name of the private endpoint connection associated with the Azure resource - ${Name}, - - [Parameter(ParameterSetName='Get', Mandatory)] - [Parameter(ParameterSetName='List', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')] - [System.String] - # The name of the Bot resource group in the user subscription. - ${ResourceGroupName}, - - [Parameter(ParameterSetName='Get', Mandatory)] - [Parameter(ParameterSetName='List', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')] - [System.String] - # The name of the Bot resource. - ${ResourceName}, - - [Parameter(ParameterSetName='Get')] - [Parameter(ParameterSetName='List')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] - [System.String[]] - # Azure Subscription ID. - ${SubscriptionId}, - - [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentity] - # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. - ${InputObject}, - - [Parameter()] - [Alias('AzureRMContext', 'AzureCredential')] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Wait for .NET debugger to attach - ${Break}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be appended to the front of the pipeline - ${HttpPipelineAppend}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be prepended to the front of the pipeline - ${HttpPipelinePrepend}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')] - [System.Uri] - # The URI for the proxy server to use - ${Proxy}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')] - [System.Management.Automation.PSCredential] - # Credentials for a proxy server to use for the remote call - ${ProxyCredential}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.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 - - $mapping = @{ - Get = 'Az.BotService.private\Get-AzBotServicePrivateEndpointConnection_Get'; - GetViaIdentity = 'Az.BotService.private\Get-AzBotServicePrivateEndpointConnection_GetViaIdentity'; - List = 'Az.BotService.private\Get-AzBotServicePrivateEndpointConnection_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.BotService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } - if ($testPlayback) { - $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') - } else { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id - } - } - - $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) - $scriptCmd = {& $wrappedCmd @PSBoundParameters} - $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) - $steppablePipeline.Begin($PSCmdlet) - } catch { - - throw - } -} - -process { - try { - $steppablePipeline.Process($_) - } catch { - - throw - } - -} -end { - try { - $steppablePipeline.End() - - } catch { - - throw - } -} -} diff --git a/generated/BotService/BotService.Autorest/internal/Get-AzBotServicePrivateLinkResource.ps1 b/generated/BotService/BotService.Autorest/internal/Get-AzBotServicePrivateLinkResource.ps1 deleted file mode 100644 index 58110759b01c..000000000000 --- a/generated/BotService/BotService.Autorest/internal/Get-AzBotServicePrivateLinkResource.ps1 +++ /dev/null @@ -1,153 +0,0 @@ - -# ---------------------------------------------------------------------------------- -# 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 -Gets the private link resources that need to be created for a Bot. -.Description -Gets the private link resources that need to be created for a Bot. -.Example -{{ Add code here }} -.Example -{{ Add code here }} - -.Outputs -Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResource -.Link -https://learn.microsoft.com/powershell/module/az.botservice/get-azbotserviceprivatelinkresource -#> -function Get-AzBotServicePrivateLinkResource { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResource])] -[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] -param( - [Parameter(Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')] - [System.String] - # The name of the Bot resource group in the user subscription. - ${ResourceGroupName}, - - [Parameter(Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')] - [System.String] - # The name of the Bot resource. - ${ResourceName}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] - [System.String[]] - # Azure Subscription ID. - ${SubscriptionId}, - - [Parameter()] - [Alias('AzureRMContext', 'AzureCredential')] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Wait for .NET debugger to attach - ${Break}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be appended to the front of the pipeline - ${HttpPipelineAppend}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be prepended to the front of the pipeline - ${HttpPipelinePrepend}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')] - [System.Uri] - # The URI for the proxy server to use - ${Proxy}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')] - [System.Management.Automation.PSCredential] - # Credentials for a proxy server to use for the remote call - ${ProxyCredential}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.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 - - $mapping = @{ - List = 'Az.BotService.private\Get-AzBotServicePrivateLinkResource_List'; - } - if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } - if ($testPlayback) { - $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') - } else { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id - } - } - - $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) - $scriptCmd = {& $wrappedCmd @PSBoundParameters} - $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) - $steppablePipeline.Begin($PSCmdlet) - } catch { - - throw - } -} - -process { - try { - $steppablePipeline.Process($_) - } catch { - - throw - } - -} -end { - try { - $steppablePipeline.End() - - } catch { - - throw - } -} -} diff --git a/generated/BotService/BotService.Autorest/internal/Get-AzBotServiceQnAMakerEndpointKey.ps1 b/generated/BotService/BotService.Autorest/internal/Get-AzBotServiceQnAMakerEndpointKey.ps1 index 04dd9f6e4946..4a2f2c9563b4 100644 --- a/generated/BotService/BotService.Autorest/internal/Get-AzBotServiceQnAMakerEndpointKey.ps1 +++ b/generated/BotService/BotService.Autorest/internal/Get-AzBotServiceQnAMakerEndpointKey.ps1 @@ -25,25 +25,14 @@ Lists the QnA Maker endpoint keys {{ Add code here }} .Inputs -Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysRequestBody -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentity +Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysRequestBody .Outputs -Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysResponse +Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysResponse .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 - [ChannelName ]: The name of the Channel resource. - [ConnectionName ]: The name of the Bot Service Connection Setting resource. - [Id ]: Resource identity path - [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource - [ResourceGroupName ]: The name of the Bot resource group in the user subscription. - [ResourceName ]: The name of the Bot resource. - [SubscriptionId ]: Azure Subscription ID. - PARAMETER : The request body for a request to Bot Service Management to list QnA Maker endpoint keys. [Authkey ]: Subscription key which provides access to this API. [Hostname ]: the host name of the QnA Maker endpoint @@ -51,47 +40,46 @@ PARAMETER : The request body for a request to https://learn.microsoft.com/powershell/module/az.botservice/get-azbotserviceqnamakerendpointkey #> function Get-AzBotServiceQnAMakerEndpointKey { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysResponse])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysResponse])] [CmdletBinding(DefaultParameterSetName='GetExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(ParameterSetName='Get')] - [Parameter(ParameterSetName='GetExpanded')] + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String[]] # Azure Subscription ID. ${SubscriptionId}, - [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] - [Parameter(ParameterSetName='GetViaIdentityExpanded', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentity] - # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. - ${InputObject}, - [Parameter(ParameterSetName='Get', Mandatory, ValueFromPipeline)] - [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysRequestBody] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysRequestBody] # The request body for a request to Bot Service Management to list QnA Maker endpoint keys. - # To construct, see NOTES section for PARAMETER properties and create a hash table. ${Parameter}, [Parameter(ParameterSetName='GetExpanded')] - [Parameter(ParameterSetName='GetViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # Subscription key which provides access to this API. ${Authkey}, [Parameter(ParameterSetName='GetExpanded')] - [Parameter(ParameterSetName='GetViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # the host name of the QnA Maker endpoint ${Hostname}, + [Parameter(ParameterSetName='GetViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] + [System.String] + # Path of Json file supplied to the Get operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='GetViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] + [System.String] + # Json string supplied to the Get operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -148,16 +136,17 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ Get = 'Az.BotService.private\Get-AzBotServiceQnAMakerEndpointKey_Get'; GetExpanded = 'Az.BotService.private\Get-AzBotServiceQnAMakerEndpointKey_GetExpanded'; - GetViaIdentity = 'Az.BotService.private\Get-AzBotServiceQnAMakerEndpointKey_GetViaIdentity'; - GetViaIdentityExpanded = 'Az.BotService.private\Get-AzBotServiceQnAMakerEndpointKey_GetViaIdentityExpanded'; + GetViaJsonFilePath = 'Az.BotService.private\Get-AzBotServiceQnAMakerEndpointKey_GetViaJsonFilePath'; + GetViaJsonString = 'Az.BotService.private\Get-AzBotServiceQnAMakerEndpointKey_GetViaJsonString'; } - if (('Get', 'GetExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get', 'GetExpanded', 'GetViaJsonFilePath', 'GetViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -166,6 +155,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/BotService/BotService.Autorest/internal/New-AzBotService.ps1 b/generated/BotService/BotService.Autorest/internal/New-AzBotService.ps1 index bdc3216d523d..955c1565e9ca 100644 --- a/generated/BotService/BotService.Autorest/internal/New-AzBotService.ps1 +++ b/generated/BotService/BotService.Autorest/internal/New-AzBotService.ps1 @@ -16,10 +16,10 @@ <# .Synopsis -Creates a Bot Service. +create a Bot Service. Bot Service is a resource group wide resource type. .Description -Creates a Bot Service. +create a Bot Service. Bot Service is a resource group wide resource type. .Example New-AzBotService -resourcegroupname BotTest-rg -name BotTest1 -ApplicationId "af5fce4d-ee68-4b25-be09-f3222582e133" -Location global -Sku F0 -Description "123134" -Registration @@ -27,12 +27,12 @@ New-AzBotService -resourcegroupname BotTest-rg -name BotTest1 -ApplicationId "af New-AzBotService -resourcegroupname BotTest-rg -name BotTest2 -ApplicationId "b1ab1727-0465-4255-a1bb-976210af972c" -Location global -Sku F0 -Description "123134" -Webapp .Outputs -Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot +Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot .Link https://learn.microsoft.com/powershell/module/az.botservice/new-azbotservice #> function New-AzBotService { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -55,209 +55,221 @@ param( # Azure Subscription ID. ${SubscriptionId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesAllSettings]))] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesAllSettings]))] [System.Collections.Hashtable] # Contains resource all settings defined as key/value pairs. ${AllSetting}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # The hint (e.g. # keyVault secret resourceId) on how to fetch the app secret ${AppPasswordHint}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # The CMK Url ${CmekKeyVaultUrl}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # The description of the bot ${Description}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # The Application Insights key ${DeveloperAppInsightKey}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # The Application Insights Api Key ${DeveloperAppInsightsApiKey}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # The Application Insights App Id ${DeveloperAppInsightsApplicationId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.Management.Automation.SwitchParameter] # Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. ${DisableLocalAuth}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # The Name of the bot ${DisplayName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # The bot's endpoint ${Endpoint}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # Entity Tag ${Etag}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # The Icon Url of the bot ${IconUrl}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.Management.Automation.SwitchParameter] # Whether Cmek is enabled ${IsCmekEnabled}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.Management.Automation.SwitchParameter] # Whether the bot is streaming supported ${IsStreamingSupported}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Kind])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("sdk", "designer", "bot", "function", "azurebot")] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Kind] + [System.String] # Required. # Gets or sets the Kind of the resource. ${Kind}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # Specifies the location of the resource. ${Location}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String[]] # Collection of LUIS App Ids ${LuisAppId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # The LUIS Key ${LuisKey}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # The bot's manifest url ${ManifestUrl}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # Microsoft App Id for the bot ${MsaAppId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # Microsoft App Managed Identity Resource Id for the bot ${MsaAppMsiResourceId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # Microsoft App Tenant Id for the bot ${MsaAppTenantId}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.MsaAppType])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("UserAssignedMSI", "SingleTenant", "MultiTenant")] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.MsaAppType] + [System.String] # Microsoft App Type for the bot ${MsaAppType}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # The hint to browser (e.g. # protocol handler) on how to open the bot for authoring ${OpenWithHint}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesParameters]))] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesParameters]))] [System.Collections.Hashtable] # Contains resource parameters defined as key/value pairs. ${Parameter}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PublicNetworkAccess])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("Enabled", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PublicNetworkAccess] + [System.String] # Whether the bot is in an isolated network ${PublicNetworkAccess}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # Publishing credentials of the resource ${PublishingCredentials}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # The channel schema transformation version for the bot ${SchemaTransformationVersion}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("F0", "S1")] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName] + [System.String] # The sku name ${SkuName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # The storage resourceId for the bot ${StorageResourceId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceTags]))] [System.Collections.Hashtable] # Contains resource tags defined as key/value pairs. ${Tag}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # The Tenant Id for the bot ${TenantId}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -314,13 +326,16 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ CreateExpanded = 'Az.BotService.private\New-AzBotService_CreateExpanded'; + CreateViaJsonFilePath = 'Az.BotService.private\New-AzBotService_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.BotService.private\New-AzBotService_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.BotService.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 { @@ -329,6 +344,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/BotService/BotService.Autorest/internal/New-AzBotServiceDirectLineKey.ps1 b/generated/BotService/BotService.Autorest/internal/New-AzBotServiceDirectLineKey.ps1 deleted file mode 100644 index f09a5af520a5..000000000000 --- a/generated/BotService/BotService.Autorest/internal/New-AzBotServiceDirectLineKey.ps1 +++ /dev/null @@ -1,175 +0,0 @@ - -# ---------------------------------------------------------------------------------- -# 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 -Regenerates secret keys and returns them for the DirectLine Channel of a particular BotService resource -.Description -Regenerates secret keys and returns them for the DirectLine Channel of a particular BotService resource -.Example -New-AzBotServiceDirectLineKey -ChannelName 'DirectLineChannel' -ResourceGroupName botTest-rg -ResourceName botTest1 -Key key1 -SiteName siteName - -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInfo -.Outputs -Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannel -.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. - -PARAMETER : Site information for WebChat or DirectLine Channels to identify which site to regenerate keys for. - Key : Determines which key is to be regenerated - SiteName : The site name -.Link -https://learn.microsoft.com/powershell/module/az.botservice/new-azbotservicedirectlinekey -#> -function New-AzBotServiceDirectLineKey { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannel])] -[CmdletBinding(DefaultParameterSetName='Regenerate', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] -param( - [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.RegenerateKeysChannelName])] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.RegenerateKeysChannelName] - # The name of the Channel resource for which keys are to be regenerated. - ${ChannelName}, - - [Parameter(Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')] - [System.String] - # The name of the Bot resource group in the user subscription. - ${ResourceGroupName}, - - [Parameter(Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')] - [System.String] - # The name of the Bot resource. - ${ResourceName}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] - [System.String] - # Azure Subscription ID. - ${SubscriptionId}, - - [Parameter(Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInfo] - # Site information for WebChat or DirectLine Channels to identify which site to regenerate keys for. - # To construct, see NOTES section for PARAMETER properties and create a hash table. - ${Parameter}, - - [Parameter()] - [Alias('AzureRMContext', 'AzureCredential')] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Wait for .NET debugger to attach - ${Break}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be appended to the front of the pipeline - ${HttpPipelineAppend}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be prepended to the front of the pipeline - ${HttpPipelinePrepend}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')] - [System.Uri] - # The URI for the proxy server to use - ${Proxy}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')] - [System.Management.Automation.PSCredential] - # Credentials for a proxy server to use for the remote call - ${ProxyCredential}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.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 - - $mapping = @{ - Regenerate = 'Az.BotService.private\New-AzBotServiceDirectLineKey_Regenerate'; - } - if (('Regenerate') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } - if ($testPlayback) { - $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') - } else { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id - } - } - - $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) - $scriptCmd = {& $wrappedCmd @PSBoundParameters} - $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) - $steppablePipeline.Begin($PSCmdlet) - } catch { - - throw - } -} - -process { - try { - $steppablePipeline.Process($_) - } catch { - - throw - } - -} -end { - try { - $steppablePipeline.End() - - } catch { - - throw - } -} -} diff --git a/generated/BotService/BotService.Autorest/internal/New-AzBotServicePrivateEndpointConnection.ps1 b/generated/BotService/BotService.Autorest/internal/New-AzBotServicePrivateEndpointConnection.ps1 deleted file mode 100644 index 19e246d13b95..000000000000 --- a/generated/BotService/BotService.Autorest/internal/New-AzBotServicePrivateEndpointConnection.ps1 +++ /dev/null @@ -1,179 +0,0 @@ - -# ---------------------------------------------------------------------------------- -# 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 the state of specified private endpoint connection associated with the Bot. -.Description -Update the state of specified private endpoint connection associated with the Bot. -.Example -{{ Add code here }} -.Example -{{ Add code here }} - -.Outputs -Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnection -.Link -https://learn.microsoft.com/powershell/module/az.botservice/new-azbotserviceprivateendpointconnection -#> -function New-AzBotServicePrivateEndpointConnection { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnection])] -[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] -param( - [Parameter(Mandatory)] - [Alias('PrivateEndpointConnectionName')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')] - [System.String] - # The name of the private endpoint connection associated with the Azure resource - ${Name}, - - [Parameter(Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')] - [System.String] - # The name of the Bot resource group in the user subscription. - ${ResourceGroupName}, - - [Parameter(Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')] - [System.String] - # The name of the Bot resource. - ${ResourceName}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] - [System.String] - # Azure Subscription ID. - ${SubscriptionId}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] - [System.String] - # A message indicating if changes on the service provider require any updates on the consumer. - ${PrivateLinkServiceConnectionStateActionsRequired}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] - [System.String] - # The reason for approval/rejection of the connection. - ${PrivateLinkServiceConnectionStateDescription}, - - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointServiceConnectionStatus])] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointServiceConnectionStatus] - # Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. - ${PrivateLinkServiceConnectionStateStatus}, - - [Parameter()] - [Alias('AzureRMContext', 'AzureCredential')] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Wait for .NET debugger to attach - ${Break}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be appended to the front of the pipeline - ${HttpPipelineAppend}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be prepended to the front of the pipeline - ${HttpPipelinePrepend}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')] - [System.Uri] - # The URI for the proxy server to use - ${Proxy}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')] - [System.Management.Automation.PSCredential] - # Credentials for a proxy server to use for the remote call - ${ProxyCredential}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.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 - - $mapping = @{ - CreateExpanded = 'Az.BotService.private\New-AzBotServicePrivateEndpointConnection_CreateExpanded'; - } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } - if ($testPlayback) { - $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') - } else { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id - } - } - - $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) - $scriptCmd = {& $wrappedCmd @PSBoundParameters} - $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) - $steppablePipeline.Begin($PSCmdlet) - } catch { - - throw - } -} - -process { - try { - $steppablePipeline.Process($_) - } catch { - - throw - } - -} -end { - try { - $steppablePipeline.End() - - } catch { - - throw - } -} -} diff --git a/generated/BotService/BotService.Autorest/internal/ProxyCmdletDefinitions.ps1 b/generated/BotService/BotService.Autorest/internal/ProxyCmdletDefinitions.ps1 index a4c69a8bf7f6..8809bcb2fac6 100644 --- a/generated/BotService/BotService.Autorest/internal/ProxyCmdletDefinitions.ps1 +++ b/generated/BotService/BotService.Autorest/internal/ProxyCmdletDefinitions.ps1 @@ -25,9 +25,9 @@ Check whether a bot name is available. {{ Add code here }} .Inputs -Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICheckNameAvailabilityRequestBody +Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityRequestBody .Outputs -Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICheckNameAvailabilityResponseBody +Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityResponseBody .Notes COMPLEX PARAMETER PROPERTIES @@ -40,14 +40,13 @@ PARAMETER : The request body for a request to https://learn.microsoft.com/powershell/module/az.botservice/get-azbotservicechecknameavailability #> function Get-AzBotServiceCheckNameAvailability { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICheckNameAvailabilityResponseBody])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityResponseBody])] [CmdletBinding(DefaultParameterSetName='GetExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Get', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICheckNameAvailabilityRequestBody] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.ICheckNameAvailabilityRequestBody] # The request body for a request to Bot Service Management to check availability of a bot name. - # To construct, see NOTES section for PARAMETER properties and create a hash table. ${Parameter}, [Parameter(ParameterSetName='GetExpanded')] @@ -62,725 +61,17 @@ param( # the type of the bot for which availability needs to be checked ${Type}, - [Parameter()] - [Alias('AzureRMContext', 'AzureCredential')] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Wait for .NET debugger to attach - ${Break}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be appended to the front of the pipeline - ${HttpPipelineAppend}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be prepended to the front of the pipeline - ${HttpPipelinePrepend}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')] - [System.Uri] - # The URI for the proxy server to use - ${Proxy}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')] - [System.Management.Automation.PSCredential] - # Credentials for a proxy server to use for the remote call - ${ProxyCredential}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.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 - - $mapping = @{ - Get = 'Az.BotService.private\Get-AzBotServiceCheckNameAvailability_Get'; - GetExpanded = 'Az.BotService.private\Get-AzBotServiceCheckNameAvailability_GetExpanded'; - } - - $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) - $scriptCmd = {& $wrappedCmd @PSBoundParameters} - $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) - $steppablePipeline.Begin($PSCmdlet) - } catch { - - throw - } -} - -process { - try { - $steppablePipeline.Process($_) - } catch { - - throw - } - -} -end { - try { - $steppablePipeline.End() - - } catch { - - throw - } -} -} - -<# -.Synopsis -Get per subscription settings needed to host bot in compute resource such as Azure App Service -.Description -Get per subscription settings needed to host bot in compute resource such as Azure App Service -.Example -Get-AzBotServiceHostSetting - -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentity -.Outputs -Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IHostSettingsResponse -.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 - [ChannelName ]: The name of the Channel resource. - [ConnectionName ]: The name of the Bot Service Connection Setting resource. - [Id ]: Resource identity path - [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource - [ResourceGroupName ]: The name of the Bot resource group in the user subscription. - [ResourceName ]: The name of the Bot resource. - [SubscriptionId ]: Azure Subscription ID. -.Link -https://learn.microsoft.com/powershell/module/az.botservice/get-azbotservicehostsetting -#> -function Get-AzBotServiceHostSetting { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IHostSettingsResponse])] -[CmdletBinding(DefaultParameterSetName='GetViaIdentity', PositionalBinding=$false)] -param( - [Parameter(Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentity] - # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. - ${InputObject}, - - [Parameter()] - [Alias('AzureRMContext', 'AzureCredential')] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Wait for .NET debugger to attach - ${Break}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be appended to the front of the pipeline - ${HttpPipelineAppend}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be prepended to the front of the pipeline - ${HttpPipelinePrepend}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')] - [System.Uri] - # The URI for the proxy server to use - ${Proxy}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')] - [System.Management.Automation.PSCredential] - # Credentials for a proxy server to use for the remote call - ${ProxyCredential}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.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 - - $mapping = @{ - GetViaIdentity = 'Az.BotService.private\Get-AzBotServiceHostSetting_GetViaIdentity'; - } - - $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) - $scriptCmd = {& $wrappedCmd @PSBoundParameters} - $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) - $steppablePipeline.Begin($PSCmdlet) - } catch { - - throw - } -} - -process { - try { - $steppablePipeline.Process($_) - } catch { - - throw - } - -} -end { - try { - $steppablePipeline.End() - - } catch { - - throw - } -} -} - -<# -.Synopsis -Lists all the available BotService operations. -.Description -Lists all the available BotService operations. -.Example -{{ Add code here }} -.Example -{{ Add code here }} - -.Outputs -Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntity -.Link -https://learn.microsoft.com/powershell/module/az.botservice/get-azbotserviceoperation -#> -function Get-AzBotServiceOperation { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IOperationEntity])] -[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] -param( - [Parameter()] - [Alias('AzureRMContext', 'AzureCredential')] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Wait for .NET debugger to attach - ${Break}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be appended to the front of the pipeline - ${HttpPipelineAppend}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be prepended to the front of the pipeline - ${HttpPipelinePrepend}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')] - [System.Uri] - # The URI for the proxy server to use - ${Proxy}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')] - [System.Management.Automation.PSCredential] - # Credentials for a proxy server to use for the remote call - ${ProxyCredential}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.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 - - $mapping = @{ - List = 'Az.BotService.private\Get-AzBotServiceOperation_List'; - } - - $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) - $scriptCmd = {& $wrappedCmd @PSBoundParameters} - $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) - $steppablePipeline.Begin($PSCmdlet) - } catch { - - throw - } -} - -process { - try { - $steppablePipeline.Process($_) - } catch { - - throw - } - -} -end { - try { - $steppablePipeline.End() - - } catch { - - throw - } -} -} - -<# -.Synopsis -Gets the specified private endpoint connection associated with the Bot. -.Description -Gets the specified private endpoint connection associated with the Bot. -.Example -{{ Add code here }} -.Example -{{ Add code here }} - -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentity -.Outputs -Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnection -.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 - [ChannelName ]: The name of the Channel resource. - [ConnectionName ]: The name of the Bot Service Connection Setting resource. - [Id ]: Resource identity path - [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource - [ResourceGroupName ]: The name of the Bot resource group in the user subscription. - [ResourceName ]: The name of the Bot resource. - [SubscriptionId ]: Azure Subscription ID. -.Link -https://learn.microsoft.com/powershell/module/az.botservice/get-azbotserviceprivateendpointconnection -#> -function Get-AzBotServicePrivateEndpointConnection { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnection])] -[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] -param( - [Parameter(ParameterSetName='Get', Mandatory)] - [Alias('PrivateEndpointConnectionName')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')] - [System.String] - # The name of the private endpoint connection associated with the Azure resource - ${Name}, - - [Parameter(ParameterSetName='Get', Mandatory)] - [Parameter(ParameterSetName='List', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')] - [System.String] - # The name of the Bot resource group in the user subscription. - ${ResourceGroupName}, - - [Parameter(ParameterSetName='Get', Mandatory)] - [Parameter(ParameterSetName='List', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')] - [System.String] - # The name of the Bot resource. - ${ResourceName}, - - [Parameter(ParameterSetName='Get')] - [Parameter(ParameterSetName='List')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] - [System.String[]] - # Azure Subscription ID. - ${SubscriptionId}, - - [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentity] - # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. - ${InputObject}, - - [Parameter()] - [Alias('AzureRMContext', 'AzureCredential')] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Wait for .NET debugger to attach - ${Break}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be appended to the front of the pipeline - ${HttpPipelineAppend}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be prepended to the front of the pipeline - ${HttpPipelinePrepend}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')] - [System.Uri] - # The URI for the proxy server to use - ${Proxy}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')] - [System.Management.Automation.PSCredential] - # Credentials for a proxy server to use for the remote call - ${ProxyCredential}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.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 - - $mapping = @{ - Get = 'Az.BotService.private\Get-AzBotServicePrivateEndpointConnection_Get'; - GetViaIdentity = 'Az.BotService.private\Get-AzBotServicePrivateEndpointConnection_GetViaIdentity'; - List = 'Az.BotService.private\Get-AzBotServicePrivateEndpointConnection_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.BotService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } - if ($testPlayback) { - $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') - } else { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id - } - } - - $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) - $scriptCmd = {& $wrappedCmd @PSBoundParameters} - $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) - $steppablePipeline.Begin($PSCmdlet) - } catch { - - throw - } -} - -process { - try { - $steppablePipeline.Process($_) - } catch { - - throw - } - -} -end { - try { - $steppablePipeline.End() - - } catch { - - throw - } -} -} - -<# -.Synopsis -Gets the private link resources that need to be created for a Bot. -.Description -Gets the private link resources that need to be created for a Bot. -.Example -{{ Add code here }} -.Example -{{ Add code here }} - -.Outputs -Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResource -.Link -https://learn.microsoft.com/powershell/module/az.botservice/get-azbotserviceprivatelinkresource -#> -function Get-AzBotServicePrivateLinkResource { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateLinkResource])] -[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] -param( - [Parameter(Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')] - [System.String] - # The name of the Bot resource group in the user subscription. - ${ResourceGroupName}, - - [Parameter(Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')] - [System.String] - # The name of the Bot resource. - ${ResourceName}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] - [System.String[]] - # Azure Subscription ID. - ${SubscriptionId}, - - [Parameter()] - [Alias('AzureRMContext', 'AzureCredential')] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Wait for .NET debugger to attach - ${Break}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be appended to the front of the pipeline - ${HttpPipelineAppend}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be prepended to the front of the pipeline - ${HttpPipelinePrepend}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')] - [System.Uri] - # The URI for the proxy server to use - ${Proxy}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')] - [System.Management.Automation.PSCredential] - # Credentials for a proxy server to use for the remote call - ${ProxyCredential}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.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 - - $mapping = @{ - List = 'Az.BotService.private\Get-AzBotServicePrivateLinkResource_List'; - } - if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } - if ($testPlayback) { - $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') - } else { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id - } - } - - $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) - $scriptCmd = {& $wrappedCmd @PSBoundParameters} - $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) - $steppablePipeline.Begin($PSCmdlet) - } catch { - - throw - } -} - -process { - try { - $steppablePipeline.Process($_) - } catch { - - throw - } - -} -end { - try { - $steppablePipeline.End() - - } catch { - - throw - } -} -} - -<# -.Synopsis -Lists the QnA Maker endpoint keys -.Description -Lists the QnA Maker endpoint keys -.Example -{{ Add code here }} -.Example -{{ Add code here }} - -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysRequestBody -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentity -.Outputs -Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysResponse -.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 - [ChannelName ]: The name of the Channel resource. - [ConnectionName ]: The name of the Bot Service Connection Setting resource. - [Id ]: Resource identity path - [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource - [ResourceGroupName ]: The name of the Bot resource group in the user subscription. - [ResourceName ]: The name of the Bot resource. - [SubscriptionId ]: Azure Subscription ID. - -PARAMETER : The request body for a request to Bot Service Management to list QnA Maker endpoint keys. - [Authkey ]: Subscription key which provides access to this API. - [Hostname ]: the host name of the QnA Maker endpoint -.Link -https://learn.microsoft.com/powershell/module/az.botservice/get-azbotserviceqnamakerendpointkey -#> -function Get-AzBotServiceQnAMakerEndpointKey { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysResponse])] -[CmdletBinding(DefaultParameterSetName='GetExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] -param( - [Parameter(ParameterSetName='Get')] - [Parameter(ParameterSetName='GetExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] - [System.String[]] - # Azure Subscription ID. - ${SubscriptionId}, - - [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] - [Parameter(ParameterSetName='GetViaIdentityExpanded', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentity] - # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. - ${InputObject}, - - [Parameter(ParameterSetName='Get', Mandatory, ValueFromPipeline)] - [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IQnAMakerEndpointKeysRequestBody] - # The request body for a request to Bot Service Management to list QnA Maker endpoint keys. - # To construct, see NOTES section for PARAMETER properties and create a hash table. - ${Parameter}, - - [Parameter(ParameterSetName='GetExpanded')] - [Parameter(ParameterSetName='GetViaIdentityExpanded')] + [Parameter(ParameterSetName='GetViaJsonFilePath', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] - # Subscription key which provides access to this API. - ${Authkey}, + # Path of Json file supplied to the Get operation + ${JsonFilePath}, - [Parameter(ParameterSetName='GetExpanded')] - [Parameter(ParameterSetName='GetViaIdentityExpanded')] + [Parameter(ParameterSetName='GetViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] - # the host name of the QnA Maker endpoint - ${Hostname}, + # Json string supplied to the Get operation + ${JsonString}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] @@ -838,24 +129,21 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ - Get = 'Az.BotService.private\Get-AzBotServiceQnAMakerEndpointKey_Get'; - GetExpanded = 'Az.BotService.private\Get-AzBotServiceQnAMakerEndpointKey_GetExpanded'; - GetViaIdentity = 'Az.BotService.private\Get-AzBotServiceQnAMakerEndpointKey_GetViaIdentity'; - GetViaIdentityExpanded = 'Az.BotService.private\Get-AzBotServiceQnAMakerEndpointKey_GetViaIdentityExpanded'; - } - if (('Get', 'GetExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } - if ($testPlayback) { - $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') - } else { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id - } + Get = 'Az.BotService.private\Get-AzBotServiceCheckNameAvailability_Get'; + GetExpanded = 'Az.BotService.private\Get-AzBotServiceCheckNameAvailability_GetExpanded'; + GetViaJsonFilePath = 'Az.BotService.private\Get-AzBotServiceCheckNameAvailability_GetViaJsonFilePath'; + GetViaJsonString = 'Az.BotService.private\Get-AzBotServiceCheckNameAvailability_GetViaJsonString'; } $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) @@ -885,66 +173,25 @@ end { } } -<# -.Synopsis -Regenerates secret keys and returns them for the DirectLine Channel of a particular BotService resource -.Description -Regenerates secret keys and returns them for the DirectLine Channel of a particular BotService resource -.Example -New-AzBotServiceDirectLineKey -ChannelName 'DirectLineChannel' -ResourceGroupName botTest-rg -ResourceName botTest1 -Key key1 -SiteName siteName - -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInfo -.Outputs -Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannel -.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. - -PARAMETER : Site information for WebChat or DirectLine Channels to identify which site to regenerate keys for. - Key : Determines which key is to be regenerated - SiteName : The site name -.Link -https://learn.microsoft.com/powershell/module/az.botservice/new-azbotservicedirectlinekey -#> -function New-AzBotServiceDirectLineKey { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannel])] -[CmdletBinding(DefaultParameterSetName='Regenerate', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] -param( - [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.RegenerateKeysChannelName])] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.RegenerateKeysChannelName] - # The name of the Channel resource for which keys are to be regenerated. - ${ChannelName}, - - [Parameter(Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')] - [System.String] - # The name of the Bot resource group in the user subscription. - ${ResourceGroupName}, - - [Parameter(Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')] - [System.String] - # The name of the Bot resource. - ${ResourceName}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] - [System.String] - # Azure Subscription ID. - ${SubscriptionId}, - - [Parameter(Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ISiteInfo] - # Site information for WebChat or DirectLine Channels to identify which site to regenerate keys for. - # To construct, see NOTES section for PARAMETER properties and create a hash table. - ${Parameter}, +<# +.Synopsis +Lists all the available BotService operations. +.Description +Lists all the available BotService operations. +.Example +{{ Add code here }} +.Example +{{ Add code here }} +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntity +.Link +https://learn.microsoft.com/powershell/module/az.botservice/get-azbotserviceoperation +#> +function Get-AzBotServiceOperation { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IOperationEntity])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -1001,21 +248,18 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ - Regenerate = 'Az.BotService.private\New-AzBotServiceDirectLineKey_Regenerate'; - } - if (('Regenerate') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } - if ($testPlayback) { - $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') - } else { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id - } + List = 'Az.BotService.private\Get-AzBotServiceOperation_List'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -1047,67 +291,69 @@ end { <# .Synopsis -Update the state of specified private endpoint connection associated with the Bot. +Lists the QnA Maker endpoint keys .Description -Update the state of specified private endpoint connection associated with the Bot. +Lists the QnA Maker endpoint keys .Example {{ Add code here }} .Example {{ Add code here }} +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysRequestBody .Outputs -Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnection +Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysResponse +.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. + +PARAMETER : The request body for a request to Bot Service Management to list QnA Maker endpoint keys. + [Authkey ]: Subscription key which provides access to this API. + [Hostname ]: the host name of the QnA Maker endpoint .Link -https://learn.microsoft.com/powershell/module/az.botservice/new-azbotserviceprivateendpointconnection +https://learn.microsoft.com/powershell/module/az.botservice/get-azbotserviceqnamakerendpointkey #> -function New-AzBotServicePrivateEndpointConnection { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IPrivateEndpointConnection])] -[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +function Get-AzBotServiceQnAMakerEndpointKey { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysResponse])] +[CmdletBinding(DefaultParameterSetName='GetExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(Mandatory)] - [Alias('PrivateEndpointConnectionName')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')] - [System.String] - # The name of the private endpoint connection associated with the Azure resource - ${Name}, - - [Parameter(Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')] - [System.String] - # The name of the Bot resource group in the user subscription. - ${ResourceGroupName}, - - [Parameter(Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')] - [System.String] - # The name of the Bot resource. - ${ResourceName}, - [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] - [System.String] + [System.String[]] # Azure Subscription ID. ${SubscriptionId}, - [Parameter()] + [Parameter(ParameterSetName='Get', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IQnAMakerEndpointKeysRequestBody] + # The request body for a request to Bot Service Management to list QnA Maker endpoint keys. + ${Parameter}, + + [Parameter(ParameterSetName='GetExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] - # A message indicating if changes on the service provider require any updates on the consumer. - ${PrivateLinkServiceConnectionStateActionsRequired}, + # Subscription key which provides access to this API. + ${Authkey}, - [Parameter()] + [Parameter(ParameterSetName='GetExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] + [System.String] + # the host name of the QnA Maker endpoint + ${Hostname}, + + [Parameter(ParameterSetName='GetViaJsonFilePath', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] - # The reason for approval/rejection of the connection. - ${PrivateLinkServiceConnectionStateDescription}, + # Path of Json file supplied to the Get operation + ${JsonFilePath}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointServiceConnectionStatus])] + [Parameter(ParameterSetName='GetViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PrivateEndpointServiceConnectionStatus] - # Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. - ${PrivateLinkServiceConnectionStateStatus}, + [System.String] + # Json string supplied to the Get operation + ${JsonString}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] @@ -1165,13 +411,17 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ - CreateExpanded = 'Az.BotService.private\New-AzBotServicePrivateEndpointConnection_CreateExpanded'; + Get = 'Az.BotService.private\Get-AzBotServiceQnAMakerEndpointKey_Get'; + GetExpanded = 'Az.BotService.private\Get-AzBotServiceQnAMakerEndpointKey_GetExpanded'; + GetViaJsonFilePath = 'Az.BotService.private\Get-AzBotServiceQnAMakerEndpointKey_GetViaJsonFilePath'; + GetViaJsonString = 'Az.BotService.private\Get-AzBotServiceQnAMakerEndpointKey_GetViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get', 'GetExpanded', 'GetViaJsonFilePath', 'GetViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -1180,6 +430,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) @@ -1211,10 +464,10 @@ end { <# .Synopsis -Creates a Bot Service. +create a Bot Service. Bot Service is a resource group wide resource type. .Description -Creates a Bot Service. +create a Bot Service. Bot Service is a resource group wide resource type. .Example New-AzBotService -resourcegroupname BotTest-rg -name BotTest1 -ApplicationId "af5fce4d-ee68-4b25-be09-f3222582e133" -Location global -Sku F0 -Description "123134" -Registration @@ -1222,12 +475,12 @@ New-AzBotService -resourcegroupname BotTest-rg -name BotTest1 -ApplicationId "af New-AzBotService -resourcegroupname BotTest-rg -name BotTest2 -ApplicationId "b1ab1727-0465-4255-a1bb-976210af972c" -Location global -Sku F0 -Description "123134" -Webapp .Outputs -Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot +Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot .Link https://learn.microsoft.com/powershell/module/az.botservice/new-azbotservice #> function New-AzBotService { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBot])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -1250,375 +503,220 @@ param( # Azure Subscription ID. ${SubscriptionId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesAllSettings]))] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesAllSettings]))] [System.Collections.Hashtable] # Contains resource all settings defined as key/value pairs. ${AllSetting}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # The hint (e.g. # keyVault secret resourceId) on how to fetch the app secret ${AppPasswordHint}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # The CMK Url ${CmekKeyVaultUrl}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # The description of the bot ${Description}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # The Application Insights key ${DeveloperAppInsightKey}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # The Application Insights Api Key ${DeveloperAppInsightsApiKey}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # The Application Insights App Id ${DeveloperAppInsightsApplicationId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.Management.Automation.SwitchParameter] # Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. ${DisableLocalAuth}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # The Name of the bot ${DisplayName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # The bot's endpoint ${Endpoint}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # Entity Tag ${Etag}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # The Icon Url of the bot ${IconUrl}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.Management.Automation.SwitchParameter] # Whether Cmek is enabled ${IsCmekEnabled}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.Management.Automation.SwitchParameter] # Whether the bot is streaming supported ${IsStreamingSupported}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Kind])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("sdk", "designer", "bot", "function", "azurebot")] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Kind] + [System.String] # Required. # Gets or sets the Kind of the resource. ${Kind}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # Specifies the location of the resource. ${Location}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String[]] # Collection of LUIS App Ids ${LuisAppId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # The LUIS Key ${LuisKey}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # The bot's manifest url ${ManifestUrl}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # Microsoft App Id for the bot ${MsaAppId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # Microsoft App Managed Identity Resource Id for the bot ${MsaAppMsiResourceId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # Microsoft App Tenant Id for the bot ${MsaAppTenantId}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.MsaAppType])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("UserAssignedMSI", "SingleTenant", "MultiTenant")] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.MsaAppType] + [System.String] # Microsoft App Type for the bot ${MsaAppType}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # The hint to browser (e.g. # protocol handler) on how to open the bot for authoring ${OpenWithHint}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesParameters]))] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotPropertiesParameters]))] [System.Collections.Hashtable] # Contains resource parameters defined as key/value pairs. ${Parameter}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PublicNetworkAccess])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("Enabled", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PublicNetworkAccess] + [System.String] # Whether the bot is in an isolated network ${PublicNetworkAccess}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # Publishing credentials of the resource ${PublishingCredentials}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # The channel schema transformation version for the bot ${SchemaTransformationVersion}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.PSArgumentCompleterAttribute("F0", "S1")] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName] + [System.String] # The sku name ${SkuName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # The storage resourceId for the bot ${StorageResourceId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IResourceTags]))] [System.Collections.Hashtable] # Contains resource tags defined as key/value pairs. ${Tag}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] # The Tenant Id for the bot ${TenantId}, - [Parameter()] - [Alias('AzureRMContext', 'AzureCredential')] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Wait for .NET debugger to attach - ${Break}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be appended to the front of the pipeline - ${HttpPipelineAppend}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be prepended to the front of the pipeline - ${HttpPipelinePrepend}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')] - [System.Uri] - # The URI for the proxy server to use - ${Proxy}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')] - [System.Management.Automation.PSCredential] - # Credentials for a proxy server to use for the remote call - ${ProxyCredential}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.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 - - $mapping = @{ - CreateExpanded = 'Az.BotService.private\New-AzBotService_CreateExpanded'; - } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } - if ($testPlayback) { - $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') - } else { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id - } - } - - $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) - $scriptCmd = {& $wrappedCmd @PSBoundParameters} - $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) - $steppablePipeline.Begin($PSCmdlet) - } catch { - - throw - } -} - -process { - try { - $steppablePipeline.Process($_) - } catch { - - throw - } - -} -end { - try { - $steppablePipeline.End() - - } catch { - - throw - } -} -} - -<# -.Synopsis -Deletes the specified private endpoint connection associated with the Bot. -.Description -Deletes the specified private endpoint connection associated with the Bot. -.Example -{{ Add code here }} -.Example -{{ Add code here }} - -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentity -.Outputs -System.Boolean -.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 - [ChannelName ]: The name of the Channel resource. - [ConnectionName ]: The name of the Bot Service Connection Setting resource. - [Id ]: Resource identity path - [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource - [ResourceGroupName ]: The name of the Bot resource group in the user subscription. - [ResourceName ]: The name of the Bot resource. - [SubscriptionId ]: Azure Subscription ID. -.Link -https://learn.microsoft.com/powershell/module/az.botservice/remove-azbotserviceprivateendpointconnection -#> -function Remove-AzBotServicePrivateEndpointConnection { -[OutputType([System.Boolean])] -[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] -param( - [Parameter(ParameterSetName='Delete', Mandatory)] - [Alias('PrivateEndpointConnectionName')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')] - [System.String] - # The name of the private endpoint connection associated with the Azure resource - ${Name}, - - [Parameter(ParameterSetName='Delete', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')] - [System.String] - # The name of the Bot resource group in the user subscription. - ${ResourceGroupName}, - - [Parameter(ParameterSetName='Delete', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] - # The name of the Bot resource. - ${ResourceName}, + # Path of Json file supplied to the Create operation + ${JsonFilePath}, - [Parameter(ParameterSetName='Delete')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')] [System.String] - # Azure Subscription ID. - ${SubscriptionId}, - - [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentity] - # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. - ${InputObject}, + # Json string supplied to the Create operation + ${JsonString}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] @@ -1649,12 +747,6 @@ param( # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Returns true when the command succeeds - ${PassThru}, - [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')] [System.Uri] @@ -1682,14 +774,16 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ - Delete = 'Az.BotService.private\Remove-AzBotServicePrivateEndpointConnection_Delete'; - DeleteViaIdentity = 'Az.BotService.private\Remove-AzBotServicePrivateEndpointConnection_DeleteViaIdentity'; + CreateExpanded = 'Az.BotService.private\New-AzBotService_CreateExpanded'; + CreateViaJsonFilePath = 'Az.BotService.private\New-AzBotService_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.BotService.private\New-AzBotService_CreateViaJsonString'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.BotService.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 { @@ -1698,6 +792,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/BotService/BotService.Autorest/internal/Remove-AzBotServicePrivateEndpointConnection.ps1 b/generated/BotService/BotService.Autorest/internal/Remove-AzBotServicePrivateEndpointConnection.ps1 deleted file mode 100644 index d184ef86ade7..000000000000 --- a/generated/BotService/BotService.Autorest/internal/Remove-AzBotServicePrivateEndpointConnection.ps1 +++ /dev/null @@ -1,189 +0,0 @@ - -# ---------------------------------------------------------------------------------- -# 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 -Deletes the specified private endpoint connection associated with the Bot. -.Description -Deletes the specified private endpoint connection associated with the Bot. -.Example -{{ Add code here }} -.Example -{{ Add code here }} - -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentity -.Outputs -System.Boolean -.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 - [ChannelName ]: The name of the Channel resource. - [ConnectionName ]: The name of the Bot Service Connection Setting resource. - [Id ]: Resource identity path - [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource - [ResourceGroupName ]: The name of the Bot resource group in the user subscription. - [ResourceName ]: The name of the Bot resource. - [SubscriptionId ]: Azure Subscription ID. -.Link -https://learn.microsoft.com/powershell/module/az.botservice/remove-azbotserviceprivateendpointconnection -#> -function Remove-AzBotServicePrivateEndpointConnection { -[OutputType([System.Boolean])] -[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] -param( - [Parameter(ParameterSetName='Delete', Mandatory)] - [Alias('PrivateEndpointConnectionName')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')] - [System.String] - # The name of the private endpoint connection associated with the Azure resource - ${Name}, - - [Parameter(ParameterSetName='Delete', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')] - [System.String] - # The name of the Bot resource group in the user subscription. - ${ResourceGroupName}, - - [Parameter(ParameterSetName='Delete', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')] - [System.String] - # The name of the Bot resource. - ${ResourceName}, - - [Parameter(ParameterSetName='Delete')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] - [System.String] - # Azure Subscription ID. - ${SubscriptionId}, - - [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentity] - # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. - ${InputObject}, - - [Parameter()] - [Alias('AzureRMContext', 'AzureCredential')] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.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.BotService.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Wait for .NET debugger to attach - ${Break}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be appended to the front of the pipeline - ${HttpPipelineAppend}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be prepended to the front of the pipeline - ${HttpPipelinePrepend}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Returns true when the command succeeds - ${PassThru}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')] - [System.Uri] - # The URI for the proxy server to use - ${Proxy}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')] - [System.Management.Automation.PSCredential] - # Credentials for a proxy server to use for the remote call - ${ProxyCredential}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.BotService.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 - - $mapping = @{ - Delete = 'Az.BotService.private\Remove-AzBotServicePrivateEndpointConnection_Delete'; - DeleteViaIdentity = 'Az.BotService.private\Remove-AzBotServicePrivateEndpointConnection_DeleteViaIdentity'; - } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } - if ($testPlayback) { - $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') - } else { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id - } - } - - $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) - $scriptCmd = {& $wrappedCmd @PSBoundParameters} - $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) - $steppablePipeline.Begin($PSCmdlet) - } catch { - - throw - } -} - -process { - try { - $steppablePipeline.Process($_) - } catch { - - throw - } - -} -end { - try { - $steppablePipeline.End() - - } catch { - - throw - } -} -} diff --git a/generated/BotService/BotService.Autorest/resources/README.md b/generated/BotService/BotService.Autorest/resources/README.md new file mode 100644 index 000000000000..937f07f8fec2 --- /dev/null +++ b/generated/BotService/BotService.Autorest/resources/README.md @@ -0,0 +1,11 @@ +# Resources +This directory can contain any additional resources for module that are not required at runtime. This directory **does not** get packaged with the module. If you have assets for custom implementation, place them into the `..\custom` folder. + +## Info +- Modifiable: yes +- Generated: no +- Committed: yes +- Packaged: no + +## Purpose +Use this folder to put anything you want to keep around as part of the repository for the module, but is not something that is required for the module. For example, development files, packaged builds, or additional information. This is only intended to be used in repositories where the module's output directory is cleaned, but tangential resources for the module want to remain intact. \ No newline at end of file diff --git a/generated/BotService/BotService.Autorest/test-module.ps1 b/generated/BotService/BotService.Autorest/test-module.ps1 index 32a4d242b28a..ca58fa3deb81 100644 --- a/generated/BotService/BotService.Autorest/test-module.ps1 +++ b/generated/BotService/BotService.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/ChangeAnalysis/ChangeAnalysis.Autorest/Az.ChangeAnalysis.csproj b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/Az.ChangeAnalysis.csproj index da2075d12b5d..7a06767622cd 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/Az.ChangeAnalysis.csproj +++ b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/Az.ChangeAnalysis.csproj @@ -2,9 +2,9 @@ ChangeAnalysis ChangeAnalysis + ChangeAnalysis.Autorest - diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/Az.ChangeAnalysis.format.ps1xml b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/Az.ChangeAnalysis.format.ps1xml index d49870343767..fc188dcb5e60 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/Az.ChangeAnalysis.format.ps1xml +++ b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/Az.ChangeAnalysis.format.ps1xml @@ -2,33 +2,21 @@ - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.ChangeAnalysisIdentity + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Change - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.ChangeAnalysisIdentity + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Change#Multiple - - - - - - - + - ResourceGroupName - - - ResourceId - - - SubscriptionId + Name @@ -36,33 +24,33 @@ - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.ErrorDetail + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.ChangeAnalysisIdentity - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.ErrorDetail + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.ChangeAnalysisIdentity#Multiple - + - + - + - Code + ResourceGroupName - Message + ResourceId - Target + SubscriptionId @@ -70,21 +58,21 @@ - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.ProxyResource + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.ChangeList - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.ProxyResource + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.ChangeList#Multiple - + - Name + NextLink @@ -92,65 +80,33 @@ - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.Resource + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.ChangeProperties - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.Resource + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.ChangeProperties#Multiple - + - - - - - - Name - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.Change - - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.Change - - - - + - - - - - - Name - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.ChangeList - - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.ChangeList - - - - + - NextLink + ChangeType + + + ResourceId + + + TimeStamp @@ -158,39 +114,33 @@ - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.ChangeProperties + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.ErrorDetail - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.ChangeProperties + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.ErrorDetail#Multiple - - - - + - + - + - ChangeType - - - InitiatedByList + Code - ResourceId + Message - TimeStamp + Target @@ -198,9 +148,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.PropertyChange + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.PropertyChange - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.PropertyChange + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.PropertyChange#Multiple @@ -268,9 +218,53 @@ - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.ResourceProviderOperationDefinition + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.ProxyResource + + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.ProxyResource#Multiple + + + + + + + + + + + + Name + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Resource + + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Resource#Multiple + + + + + + + + + + + + Name + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.ResourceProviderOperationDefinition - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.ResourceProviderOperationDefinition + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.ResourceProviderOperationDefinition#Multiple @@ -290,9 +284,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.ResourceProviderOperationDisplay + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.ResourceProviderOperationDisplay - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.ResourceProviderOperationDisplay + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.ResourceProviderOperationDisplay#Multiple @@ -330,9 +324,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.ResourceProviderOperationList + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.ResourceProviderOperationList - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.ResourceProviderOperationList + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.ResourceProviderOperationList#Multiple diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/Az.ChangeAnalysis.psd1 b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/Az.ChangeAnalysis.psd1 index 780e0e75b386..35202fcad287 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/Az.ChangeAnalysis.psd1 +++ b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/Az.ChangeAnalysis.psd1 @@ -11,8 +11,7 @@ DotNetFrameworkVersion = '4.7.2' RequiredAssemblies = './bin/Az.ChangeAnalysis.private.dll' FormatsToProcess = './Az.ChangeAnalysis.format.ps1xml' - FunctionsToExport = 'Get-AzChangeAnalysis', '*' - AliasesToExport = '*' + FunctionsToExport = 'Get-AzChangeAnalysis' PrivateData = @{ PSData = @{ Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'ChangeAnalysis' diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/Properties/AssemblyInfo.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/Properties/AssemblyInfo.cs index 0a5de3691b87..481d3aec63a2 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/Properties/AssemblyInfo.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/Properties/AssemblyInfo.cs @@ -1,28 +1,26 @@ -// ---------------------------------------------------------------------------------- -// -// Copyright Microsoft Corporation -// Licensed under the Apache License, Version 2.0 (the "License"); +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the Apache License, Version 2.0 (the ""License""); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, +// distributed under the License is distributed on an ""AS IS"" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// ---------------------------------------------------------------------------------- +// Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code +// is regenerated. using System; using System.Reflection; +using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -[assembly: AssemblyTitle("Microsoft Azure Powershell - ChangeAnalysis")] -[assembly: AssemblyCompany(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCompany)] -[assembly: AssemblyProduct(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyProduct)] -[assembly: AssemblyCopyright(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCopyright)] - -[assembly: ComVisible(false)] -[assembly: CLSCompliant(false)] -[assembly: Guid("cde55d5b-e320-46a4-a5da-ca6570885fab")] -[assembly: AssemblyVersion("0.1.2")] -[assembly: AssemblyFileVersion("0.1.2")] +[assembly: System.Reflection.AssemblyCompanyAttribute("Microsoft")] +[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")] +[assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")] +[assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - ChangeAnalysis")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("0.1.2")] +[assembly: System.Reflection.AssemblyVersionAttribute("0.1.2")] +[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)] +[assembly: System.CLSCompliantAttribute(false)] diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/check-dependencies.ps1 b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/check-dependencies.ps1 index c29591c7bfe1..90ca9867ae40 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/check-dependencies.ps1 +++ b/generated/ChangeAnalysis/ChangeAnalysis.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/ChangeAnalysis/ChangeAnalysis.Autorest/exports/Get-AzChangeAnalysis.ps1 b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/exports/Get-AzChangeAnalysis.ps1 index e4cab3ca1a66..189d80d122de 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/exports/Get-AzChangeAnalysis.ps1 +++ b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/exports/Get-AzChangeAnalysis.ps1 @@ -35,12 +35,12 @@ $end = Get-Date -Date "2021-07-18T12:09:03.141Z" -AsUTC Get-AzChangeAnalysis -StartTime $start -EndTime $end -ResourceId '/subscriptions/xxxxxx-xxxxx-xxxx-xxxx-xxxxxxf/resourceGroups/azpssmokerg1268133cx4/providers/Microsoft.Storage/storageAccounts/azpssmokesa1268133cx4' .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChange +Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChange .Link https://learn.microsoft.com/powershell/module/az.changeanalysis/get-azchangeanalysis #> function Get-AzChangeAnalysis { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChange])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChange])] [CmdletBinding(DefaultParameterSetName='List2', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='List', Mandatory)] @@ -139,6 +139,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -162,9 +171,7 @@ begin { List1 = 'Az.ChangeAnalysis.private\Get-AzChangeAnalysis_List1'; List2 = 'Az.ChangeAnalysis.private\Get-AzChangeAnalysis_List2'; } - if (('List1', 'List2') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('List1', 'List2') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -178,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/ChangeAnalysis/ChangeAnalysis.Autorest/exports/ProxyCmdletDefinitions.ps1 b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/exports/ProxyCmdletDefinitions.ps1 index e4cab3ca1a66..189d80d122de 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/exports/ProxyCmdletDefinitions.ps1 +++ b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/exports/ProxyCmdletDefinitions.ps1 @@ -35,12 +35,12 @@ $end = Get-Date -Date "2021-07-18T12:09:03.141Z" -AsUTC Get-AzChangeAnalysis -StartTime $start -EndTime $end -ResourceId '/subscriptions/xxxxxx-xxxxx-xxxx-xxxx-xxxxxxf/resourceGroups/azpssmokerg1268133cx4/providers/Microsoft.Storage/storageAccounts/azpssmokesa1268133cx4' .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChange +Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChange .Link https://learn.microsoft.com/powershell/module/az.changeanalysis/get-azchangeanalysis #> function Get-AzChangeAnalysis { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChange])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChange])] [CmdletBinding(DefaultParameterSetName='List2', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='List', Mandatory)] @@ -139,6 +139,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -162,9 +171,7 @@ begin { List1 = 'Az.ChangeAnalysis.private\Get-AzChangeAnalysis_List1'; List2 = 'Az.ChangeAnalysis.private\Get-AzChangeAnalysis_List2'; } - if (('List1', 'List2') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('List1', 'List2') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -178,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/ChangeAnalysis/ChangeAnalysis.Autorest/generate-info.json b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generate-info.json index 5f519d42ba9d..fa72d369e49a 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generate-info.json +++ b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generate-info.json @@ -1,3 +1,3 @@ { - "generate_Id": "2d249f46-6ff8-4899-93e3-9c38eb7d4408" + "generate_Id": "52f711d3-1e7f-4991-8033-3185b833637c" } diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/Module.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/Module.cs index 99cc7289a99f..d74376b9685e 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/Module.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.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.ChangeAnalysis.Module _instance; + /// the ISendAsync pipeline instance private Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.HttpPipeline _pipeline; /// the ISendAsync pipeline instance (when proxy is enabled) private Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.HttpPipeline _pipelineWithProxy; + private static readonly global::System.Object _singletonLock = new global::System.Object(); + public bool _useProxy = false; public global::System.Net.WebProxy _webProxy = new global::System.Net.WebProxy(); @@ -56,11 +64,8 @@ public partial class Module /// The delegate to get the telemetry info. public GetTelemetryInfoDelegate GetTelemetryInfo { get; set; } - /// Backing field for property. - private static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Module _instance; - /// the singleton of this module class - public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Module Instance => Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Module._instance?? (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Module._instance = new Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Module()); + public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis"; @@ -125,9 +130,17 @@ public Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.HttpPipeline Cr /// 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/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/ChangeAnalysis.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/ChangeAnalysis.cs index 2c35793e5f44..a40f7ef0df96 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/ChangeAnalysis.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/ChangeAnalysis.cs @@ -31,7 +31,7 @@ public partial class ChangeAnalysis /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ChangeAnalysisListByResourceGroup(string subscriptionId, string resourceGroupName, global::System.DateTime StartTime, global::System.DateTime EndTime, string SkipToken, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ChangeAnalysisListByResourceGroup(string subscriptionId, string resourceGroupName, global::System.DateTime StartTime, global::System.DateTime EndTime, string SkipToken, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.ISendAsync sender) { var apiVersion = @"2021-04-01"; // Constant Parameters @@ -63,7 +63,7 @@ public partial class ChangeAnalysis await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ChangeAnalysisListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + await this.ChangeAnalysisListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); } } @@ -84,7 +84,7 @@ public partial class ChangeAnalysis /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ChangeAnalysisListByResourceGroupViaIdentity(global::System.String viaIdentity, global::System.DateTime StartTime, global::System.DateTime EndTime, string SkipToken, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ChangeAnalysisListByResourceGroupViaIdentity(global::System.String viaIdentity, global::System.DateTime StartTime, global::System.DateTime EndTime, string SkipToken, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.ISendAsync sender) { var apiVersion = @"2021-04-01"; // Constant Parameters @@ -127,11 +127,187 @@ public partial class ChangeAnalysis await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ChangeAnalysisListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + await this.ChangeAnalysisListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. + /// + /// List the changes of a resource group within the specified time range. Customer data will always be masked. + /// + /// + /// Specifies the start time of the changes request. + /// Specifies the end time of the changes request. + /// A skip token is used to continue retrieving items after an operation returns a partial result. + /// If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter + /// that specifies a starting point to use for subsequent calls. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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 ChangeAnalysisListByResourceGroupViaIdentityWithResult(global::System.String viaIdentity, global::System.DateTime StartTime, global::System.DateTime EndTime, string SkipToken, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-04-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.ChangeAnalysis/changes$", 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.ChangeAnalysis/changes'"); + } + + // 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.ChangeAnalysis/changes" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + "$startTime=" + StartTime.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture) + + "&" + + "$endTime=" + EndTime.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture) + + "&" + + (string.IsNullOrEmpty(SkipToken) ? global::System.String.Empty : "$skipToken=" + global::System.Uri.EscapeDataString(SkipToken)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ChangeAnalysisListByResourceGroupWithResult_Call (request, eventListener,sender); + } + } + + /// + /// List the changes of a resource group within the specified time range. Customer data will always be masked. + /// + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Specifies the start time of the changes request. + /// Specifies the end time of the changes request. + /// A skip token is used to continue retrieving items after an operation returns a partial result. + /// If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter + /// that specifies a starting point to use for subsequent calls. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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 ChangeAnalysisListByResourceGroupWithResult(string subscriptionId, string resourceGroupName, global::System.DateTime StartTime, global::System.DateTime EndTime, string SkipToken, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-04-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.ChangeAnalysis/changes" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + "$startTime=" + StartTime.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture) + + "&" + + "$endTime=" + EndTime.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture) + + "&" + + (string.IsNullOrEmpty(SkipToken) ? global::System.String.Empty : "$skipToken=" + global::System.Uri.EscapeDataString(SkipToken)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ChangeAnalysisListByResourceGroupWithResult_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.ChangeAnalysis.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 ChangeAnalysisListByResourceGroupWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.ChangeList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis.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.ChangeAnalysis.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 @@ -141,7 +317,7 @@ public partial class ChangeAnalysis /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ChangeAnalysisListByResourceGroup_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.ChangeAnalysis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ChangeAnalysisListByResourceGroup_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.ChangeAnalysis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -152,6 +328,7 @@ public partial class ChangeAnalysis await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -159,13 +336,13 @@ public partial class ChangeAnalysis case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.ChangeList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.ChangeList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -204,7 +381,7 @@ public partial class ChangeAnalysis await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); await eventListener.AssertNotNull(nameof(SkipToken),SkipToken); } } @@ -227,7 +404,7 @@ public partial class ChangeAnalysis /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ChangeAnalysisListByResourceId(string resourceId, global::System.DateTime StartTime, global::System.DateTime EndTime, string SkipToken, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ChangeAnalysisListByResourceId(string resourceId, global::System.DateTime StartTime, global::System.DateTime EndTime, string SkipToken, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.ISendAsync sender) { var apiVersion = @"2021-04-01"; // Constant Parameters @@ -257,7 +434,7 @@ public partial class ChangeAnalysis await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ChangeAnalysisListByResourceId_Call(request,onOk,onDefault,eventListener,sender); + await this.ChangeAnalysisListByResourceId_Call (request, onOk,onDefault,eventListener,sender); } } @@ -279,7 +456,7 @@ public partial class ChangeAnalysis /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ChangeAnalysisListByResourceIdViaIdentity(global::System.String viaIdentity, global::System.DateTime StartTime, global::System.DateTime EndTime, string SkipToken, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ChangeAnalysisListByResourceIdViaIdentity(global::System.String viaIdentity, global::System.DateTime StartTime, global::System.DateTime EndTime, string SkipToken, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.ISendAsync sender) { var apiVersion = @"2021-04-01"; // Constant Parameters @@ -290,7 +467,7 @@ public partial class ChangeAnalysis var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.ChangeAnalysis$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/{resourceId}/providers/Microsoft.ChangeAnalysis/resourceChanges'"); + throw new global::System.Exception("Invalid identity for URI '/{resourceId}/providers/Microsoft.ChangeAnalysis'"); } // replace URI parameters with values from identity @@ -319,11 +496,183 @@ public partial class ChangeAnalysis await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ChangeAnalysisListByResourceId_Call(request,onOk,onDefault,eventListener,sender); + await this.ChangeAnalysisListByResourceId_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Customer data is always masked if query at subscription or resource group level. For query on a single resource, customer + /// data is masked if the user doesn’t have access. + /// + /// + /// Specifies the start time of the changes request. + /// Specifies the end time of the changes request. + /// A skip token is used to continue retrieving items after an operation returns a partial result. + /// If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter + /// that specifies a starting point to use for subsequent calls. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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 ChangeAnalysisListByResourceIdViaIdentityWithResult(global::System.String viaIdentity, global::System.DateTime StartTime, global::System.DateTime EndTime, string SkipToken, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-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.ChangeAnalysis$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{resourceId}/providers/Microsoft.ChangeAnalysis'"); + } + + // replace URI parameters with values from identity + var resourceId = _match.Groups["resourceId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + resourceId + + "/providers/Microsoft.ChangeAnalysis/resourceChanges" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + "$startTime=" + StartTime.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture) + + "&" + + "$endTime=" + EndTime.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture) + + "&" + + (string.IsNullOrEmpty(SkipToken) ? global::System.String.Empty : "$skipToken=" + global::System.Uri.EscapeDataString(SkipToken)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ChangeAnalysisListByResourceIdWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Customer data is always masked if query at subscription or resource group level. For query on a single resource, customer + /// data is masked if the user doesn’t have access. + /// + /// The identifier of the resource. + /// Specifies the start time of the changes request. + /// Specifies the end time of the changes request. + /// A skip token is used to continue retrieving items after an operation returns a partial result. + /// If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter + /// that specifies a starting point to use for subsequent calls. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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 ChangeAnalysisListByResourceIdWithResult(string resourceId, global::System.DateTime StartTime, global::System.DateTime EndTime, string SkipToken, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-04-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + global::System.Uri.EscapeDataString(resourceId) + + "/providers/Microsoft.ChangeAnalysis/resourceChanges" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + "$startTime=" + StartTime.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture) + + "&" + + "$endTime=" + EndTime.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture) + + "&" + + (string.IsNullOrEmpty(SkipToken) ? global::System.String.Empty : "$skipToken=" + global::System.Uri.EscapeDataString(SkipToken)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ChangeAnalysisListByResourceIdWithResult_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.ChangeAnalysis.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 ChangeAnalysisListByResourceIdWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.ChangeList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis.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.ChangeAnalysis.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 @@ -333,7 +682,7 @@ public partial class ChangeAnalysis /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ChangeAnalysisListByResourceId_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.ChangeAnalysis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ChangeAnalysisListByResourceId_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.ChangeAnalysis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -344,6 +693,7 @@ public partial class ChangeAnalysis await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -351,13 +701,13 @@ public partial class ChangeAnalysis case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.ChangeList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.ChangeList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -412,7 +762,7 @@ public partial class ChangeAnalysis /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ChangeAnalysisListBySubscription(string subscriptionId, global::System.DateTime StartTime, global::System.DateTime EndTime, string SkipToken, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ChangeAnalysisListBySubscription(string subscriptionId, global::System.DateTime StartTime, global::System.DateTime EndTime, string SkipToken, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.ISendAsync sender) { var apiVersion = @"2021-04-01"; // Constant Parameters @@ -442,7 +792,7 @@ public partial class ChangeAnalysis await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ChangeAnalysisListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + await this.ChangeAnalysisListBySubscription_Call (request, onOk,onDefault,eventListener,sender); } } @@ -463,7 +813,7 @@ public partial class ChangeAnalysis /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ChangeAnalysisListBySubscriptionViaIdentity(global::System.String viaIdentity, global::System.DateTime StartTime, global::System.DateTime EndTime, string SkipToken, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ChangeAnalysisListBySubscriptionViaIdentity(global::System.String viaIdentity, global::System.DateTime StartTime, global::System.DateTime EndTime, string SkipToken, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.ISendAsync sender) { var apiVersion = @"2021-04-01"; // Constant Parameters @@ -503,11 +853,181 @@ public partial class ChangeAnalysis await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ChangeAnalysisListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + await this.ChangeAnalysisListBySubscription_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// List the changes of a subscription within the specified time range. Customer data will always be masked. + /// + /// + /// Specifies the start time of the changes request. + /// Specifies the end time of the changes request. + /// A skip token is used to continue retrieving items after an operation returns a partial result. + /// If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter + /// that specifies a starting point to use for subsequent calls. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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 ChangeAnalysisListBySubscriptionViaIdentityWithResult(global::System.String viaIdentity, global::System.DateTime StartTime, global::System.DateTime EndTime, string SkipToken, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-04-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.ChangeAnalysis/changes$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.ChangeAnalysis/changes'"); + } + + // 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.ChangeAnalysis/changes" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + "$startTime=" + StartTime.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture) + + "&" + + "$endTime=" + EndTime.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture) + + "&" + + (string.IsNullOrEmpty(SkipToken) ? global::System.String.Empty : "$skipToken=" + global::System.Uri.EscapeDataString(SkipToken)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ChangeAnalysisListBySubscriptionWithResult_Call (request, eventListener,sender); + } + } + + /// + /// List the changes of a subscription within the specified time range. Customer data will always be masked. + /// + /// The ID of the target subscription. + /// Specifies the start time of the changes request. + /// Specifies the end time of the changes request. + /// A skip token is used to continue retrieving items after an operation returns a partial result. + /// If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter + /// that specifies a starting point to use for subsequent calls. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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 ChangeAnalysisListBySubscriptionWithResult(string subscriptionId, global::System.DateTime StartTime, global::System.DateTime EndTime, string SkipToken, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-04-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.ChangeAnalysis/changes" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + "$startTime=" + StartTime.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture) + + "&" + + "$endTime=" + EndTime.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture) + + "&" + + (string.IsNullOrEmpty(SkipToken) ? global::System.String.Empty : "$skipToken=" + global::System.Uri.EscapeDataString(SkipToken)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ChangeAnalysisListBySubscriptionWithResult_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.ChangeAnalysis.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 ChangeAnalysisListBySubscriptionWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.ChangeList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis.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.ChangeAnalysis.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 @@ -517,7 +1037,7 @@ public partial class ChangeAnalysis /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ChangeAnalysisListBySubscription_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.ChangeAnalysis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ChangeAnalysisListBySubscription_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.ChangeAnalysis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -528,6 +1048,7 @@ public partial class ChangeAnalysis await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -535,13 +1056,13 @@ public partial class ChangeAnalysis case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.ChangeList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.ChangeList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -594,7 +1115,7 @@ public partial class ChangeAnalysis /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task OperationsList(string SkipToken, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task OperationsList(string SkipToken, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.ISendAsync sender) { var apiVersion = @"2021-04-01"; // Constant Parameters @@ -618,7 +1139,7 @@ public partial class ChangeAnalysis await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.OperationsList_Call(request,onOk,onDefault,eventListener,sender); + await this.OperationsList_Call (request, onOk,onDefault,eventListener,sender); } } @@ -637,7 +1158,7 @@ public partial class ChangeAnalysis /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task OperationsListViaIdentity(global::System.String viaIdentity, string SkipToken, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task OperationsListViaIdentity(global::System.String viaIdentity, string SkipToken, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.ISendAsync sender) { var apiVersion = @"2021-04-01"; // Constant Parameters @@ -670,11 +1191,161 @@ public partial class ChangeAnalysis await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.OperationsList_Call(request,onOk,onDefault,eventListener,sender); + await this.OperationsList_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Lists all the supported operations by the Microsoft.ChangeAnalysis resource provider along with their descriptions. + /// + /// + /// A skip token is used to continue retrieving items after an operation returns a partial result. + /// If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter + /// that specifies a starting point to use for subsequent calls. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OperationsListViaIdentityWithResult(global::System.String viaIdentity, string SkipToken, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-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.ChangeAnalysis/operations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.ChangeAnalysis/operations'"); + } + + // replace URI parameters with values from identity + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.ChangeAnalysis/operations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(SkipToken) ? global::System.String.Empty : "$skipToken=" + global::System.Uri.EscapeDataString(SkipToken)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.OperationsListWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Lists all the supported operations by the Microsoft.ChangeAnalysis resource provider along with their descriptions. + /// + /// A skip token is used to continue retrieving items after an operation returns a partial result. + /// If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter + /// that specifies a starting point to use for subsequent calls. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OperationsListWithResult(string SkipToken, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-04-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.ChangeAnalysis/operations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(SkipToken) ? global::System.String.Empty : "$skipToken=" + global::System.Uri.EscapeDataString(SkipToken)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.OperationsListWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task OperationsListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.ResourceProviderOperationList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis.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.ChangeAnalysis.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 @@ -684,7 +1355,7 @@ public partial class ChangeAnalysis /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task OperationsList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task OperationsList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -695,6 +1366,7 @@ public partial class ChangeAnalysis await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -702,13 +1374,13 @@ public partial class ChangeAnalysis case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.ResourceProviderOperationList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.ResourceProviderOperationList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Any.PowerShell.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Any.PowerShell.cs index 485c7da0d646..2f14c99f969d 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Any.PowerShell.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Any.PowerShell.cs @@ -7,7 +7,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models { using Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.PowerShell; - /// Any object + /// Anything [System.ComponentModel.TypeConverter(typeof(AnyTypeConverter))] public partial class Any { @@ -54,6 +54,14 @@ public partial class Any 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 . @@ -125,8 +133,20 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IAny Dese /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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(); + } } - /// Any object + /// Anything [System.ComponentModel.TypeConverter(typeof(AnyTypeConverter))] public partial interface IAny diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Any.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Any.cs index 92251cda6000..5419b9733a10 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Any.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Any.cs @@ -7,7 +7,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Extensions; - /// Any object + /// Anything public partial class Any : Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IAny, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IAnyInternal @@ -19,13 +19,13 @@ public Any() } } - /// Any object + /// Anything public partial interface IAny : Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.IJsonSerializable { } - /// Any object + /// Anything internal partial interface IAnyInternal { diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Any.json.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Any.json.cs index 5da09217834a..e3f0c9ad89f6 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Any.json.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Any.json.cs @@ -7,7 +7,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Extensions; - /// Any object + /// Anything public partial class Any { diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/Change.PowerShell.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Change.PowerShell.cs similarity index 57% rename from generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/Change.PowerShell.cs rename to generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Change.PowerShell.cs index 641f6b86662f..39875b75dbc7 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/Change.PowerShell.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Change.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.ChangeAnalysis.Models.Api20210401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models { using Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.PowerShell; @@ -55,7 +55,15 @@ public partial class Change 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,45 +78,45 @@ internal Change(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangeInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangeProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangeInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.ChangePropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.ChangePropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("ChangeType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangeInternal)this).ChangeType = (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support.ChangeType?) content.GetValueForProperty("ChangeType",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangeInternal)this).ChangeType, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support.ChangeType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeInternal)this).ChangeType = (string) content.GetValueForProperty("ChangeType",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeInternal)this).ChangeType, global::System.Convert.ToString); } if (content.Contains("ResourceId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangeInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangeInternal)this).ResourceId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeInternal)this).ResourceId, global::System.Convert.ToString); } if (content.Contains("TimeStamp")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangeInternal)this).TimeStamp = (global::System.DateTime?) content.GetValueForProperty("TimeStamp",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangeInternal)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.ChangeAnalysis.Models.IChangeInternal)this).TimeStamp = (global::System.DateTime?) content.GetValueForProperty("TimeStamp",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeInternal)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("InitiatedByList")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangeInternal)this).InitiatedByList = (string[]) content.GetValueForProperty("InitiatedByList",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangeInternal)this).InitiatedByList, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeInternal)this).InitiatedByList = (System.Collections.Generic.List) content.GetValueForProperty("InitiatedByList",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeInternal)this).InitiatedByList, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("PropertyChange")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangeInternal)this).PropertyChange = (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IPropertyChange[]) content.GetValueForProperty("PropertyChange",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangeInternal)this).PropertyChange, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.PropertyChangeTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeInternal)this).PropertyChange = (System.Collections.Generic.List) content.GetValueForProperty("PropertyChange",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeInternal)this).PropertyChange, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.PropertyChangeTypeConverter.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,65 +131,65 @@ internal Change(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangeInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangeProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangeInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.ChangePropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.ChangePropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("ChangeType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangeInternal)this).ChangeType = (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support.ChangeType?) content.GetValueForProperty("ChangeType",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangeInternal)this).ChangeType, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support.ChangeType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeInternal)this).ChangeType = (string) content.GetValueForProperty("ChangeType",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeInternal)this).ChangeType, global::System.Convert.ToString); } if (content.Contains("ResourceId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangeInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangeInternal)this).ResourceId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeInternal)this).ResourceId, global::System.Convert.ToString); } if (content.Contains("TimeStamp")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangeInternal)this).TimeStamp = (global::System.DateTime?) content.GetValueForProperty("TimeStamp",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangeInternal)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.ChangeAnalysis.Models.IChangeInternal)this).TimeStamp = (global::System.DateTime?) content.GetValueForProperty("TimeStamp",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeInternal)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("InitiatedByList")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangeInternal)this).InitiatedByList = (string[]) content.GetValueForProperty("InitiatedByList",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangeInternal)this).InitiatedByList, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeInternal)this).InitiatedByList = (System.Collections.Generic.List) content.GetValueForProperty("InitiatedByList",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeInternal)this).InitiatedByList, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("PropertyChange")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangeInternal)this).PropertyChange = (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IPropertyChange[]) content.GetValueForProperty("PropertyChange",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangeInternal)this).PropertyChange, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.PropertyChangeTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeInternal)this).PropertyChange = (System.Collections.Generic.List) content.GetValueForProperty("PropertyChange",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeInternal)this).PropertyChange, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.PropertyChangeTypeConverter.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.ChangeAnalysis.Models.Api20210401.IChange DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChange DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new Change(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.ChangeAnalysis.Models.Api20210401.IChange DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChange DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new Change(content); } @@ -191,12 +199,24 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api202104 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChange FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChange FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis.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 detected change. [System.ComponentModel.TypeConverter(typeof(ChangeTypeConverter))] diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/Change.TypeConverter.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Change.TypeConverter.cs similarity index 98% rename from generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/Change.TypeConverter.cs rename to generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Change.TypeConverter.cs index 454223a5b8d3..4bf388fe57ff 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/Change.TypeConverter.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Change.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.ChangeAnalysis.Models.Api20210401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models { using Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis.Models.Api20210401.IChange ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChange ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChange).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChange).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/Change.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Change.cs similarity index 63% rename from generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/Change.cs rename to generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Change.cs index 86d60963dec5..26b32f480bac 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/Change.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Change.cs @@ -3,79 +3,79 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Extensions; /// The detected change. public partial class Change : - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChange, - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangeInternal, + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChange, + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeInternal, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.Resource(); + private Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IProxyResource __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.ProxyResource(); /// The type of the change. [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Origin(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support.ChangeType? ChangeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangePropertiesInternal)Property).ChangeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangePropertiesInternal)Property).ChangeType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support.ChangeType)""); } + public string ChangeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangePropertiesInternal)Property).ChangeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangePropertiesInternal)Property).ChangeType = value ?? null; } /// /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Origin(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResourceInternal)__resource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceInternal)__proxyResource).Id; } /// /// The list of identities who might initiated the change. /// The identity could be user name (email address) or the object ID of the Service Principal. /// [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Origin(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.PropertyOrigin.Inlined)] - public string[] InitiatedByList { get => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangePropertiesInternal)Property).InitiatedByList; set => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangePropertiesInternal)Property).InitiatedByList = value ?? null /* arrayOf */; } + public System.Collections.Generic.List InitiatedByList { get => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangePropertiesInternal)Property).InitiatedByList; set => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangePropertiesInternal)Property).InitiatedByList = value ?? null /* arrayOf */; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeProperties Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.ChangeProperties()); set { {_property = value;} } } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResourceInternal)__resource).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceInternal)__proxyResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceInternal)__proxyResource).Id = value; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResourceInternal)__resource).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceInternal)__proxyResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceInternal)__proxyResource).Name = value; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResourceInternal)__resource).Type = value; } - - /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangeProperties Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangeInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.ChangeProperties()); set { {_property = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceInternal)__proxyResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceInternal)__proxyResource).Type = value; } /// The name of the resource [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Origin(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResourceInternal)__resource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceInternal)__proxyResource).Name; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangeProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeProperties _property; /// The properties of a change. [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Origin(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangeProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.ChangeProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.ChangeProperties()); set => this._property = value; } /// The list of detailed changes at json property level. [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Origin(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IPropertyChange[] PropertyChange { get => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangePropertiesInternal)Property).PropertyChange; set => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangePropertiesInternal)Property).PropertyChange = value ?? null /* arrayOf */; } + public System.Collections.Generic.List PropertyChange { get => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangePropertiesInternal)Property).PropertyChange; set => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangePropertiesInternal)Property).PropertyChange = value ?? null /* arrayOf */; } /// The resource id that the change is attached to. [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Origin(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.PropertyOrigin.Inlined)] - public string ResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangePropertiesInternal)Property).ResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangePropertiesInternal)Property).ResourceId = value ?? null; } + public string ResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangePropertiesInternal)Property).ResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangePropertiesInternal)Property).ResourceId = value ?? null; } /// The time when the change is detected. [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Origin(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.PropertyOrigin.Inlined)] - public global::System.DateTime? TimeStamp { get => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangePropertiesInternal)Property).TimeStamp; set => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangePropertiesInternal)Property).TimeStamp = value ?? default(global::System.DateTime); } + public global::System.DateTime? TimeStamp { get => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangePropertiesInternal)Property).TimeStamp; set => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangePropertiesInternal)Property).TimeStamp = value ?? default(global::System.DateTime); } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" /// [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Origin(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResourceInternal)__resource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceInternal)__proxyResource).Type; } /// Creates an new instance. public Change() @@ -91,23 +91,27 @@ public Change() /// public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.IEventListener eventListener) { - await eventListener.AssertNotNull(nameof(__resource), __resource); - await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + await eventListener.AssertNotNull(nameof(__proxyResource), __proxyResource); + await eventListener.AssertObjectIsValid(nameof(__proxyResource), __proxyResource); } } /// The detected change. public partial interface IChange : Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResource + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IProxyResource { /// The type of the change. [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of the change.", SerializedName = @"changeType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support.ChangeType) })] - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support.ChangeType? ChangeType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.PSArgumentCompleterAttribute("Add", "Remove", "Update")] + string ChangeType { get; set; } /// /// The list of identities who might initiated the change. /// The identity could be user name (email address) or the object ID of the Service Principal. @@ -115,23 +119,32 @@ public partial interface IChange : [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of identities who might initiated the change. The identity could be user name (email address) or the object ID of the Service Principal.", SerializedName = @"initiatedByList", PossibleTypes = new [] { typeof(string) })] - string[] InitiatedByList { get; set; } + System.Collections.Generic.List InitiatedByList { get; set; } /// The list of detailed changes at json property level. [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of detailed changes at json property level.", SerializedName = @"propertyChanges", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IPropertyChange) })] - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IPropertyChange[] PropertyChange { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IPropertyChange) })] + System.Collections.Generic.List PropertyChange { get; set; } /// The resource id that the change is attached to. [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The resource id that the change is attached to.", SerializedName = @"resourceId", PossibleTypes = new [] { typeof(string) })] @@ -140,6 +153,9 @@ The identity could be user name (email address) or the object ID of the Service [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The time when the change is detected.", SerializedName = @"timeStamp", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -148,19 +164,20 @@ The identity could be user name (email address) or the object ID of the Service } /// The detected change. internal partial interface IChangeInternal : - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IProxyResourceInternal { /// The type of the change. - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support.ChangeType? ChangeType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.PSArgumentCompleterAttribute("Add", "Remove", "Update")] + string ChangeType { get; set; } /// /// The list of identities who might initiated the change. /// The identity could be user name (email address) or the object ID of the Service Principal. /// - string[] InitiatedByList { get; set; } + System.Collections.Generic.List InitiatedByList { get; set; } /// The properties of a change. - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangeProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeProperties Property { get; set; } /// The list of detailed changes at json property level. - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IPropertyChange[] PropertyChange { get; set; } + System.Collections.Generic.List PropertyChange { get; set; } /// The resource id that the change is attached to. string ResourceId { get; set; } /// The time when the change is detected. diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/Change.json.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Change.json.cs similarity index 92% rename from generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/Change.json.cs rename to generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Change.json.cs index ce11319dd073..46ced3845162 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/Change.json.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Change.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.ChangeAnalysis.Models.Api20210401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Extensions; @@ -65,19 +65,19 @@ internal Change(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.J { return; } - __resource = new Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.Resource(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.ChangeProperties.FromJson(__jsonProperties) : Property;} + __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.ProxyResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.ChangeProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChange. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChange. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChange. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChange. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChange FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChange FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonObject json ? new Change(json) : null; } @@ -101,7 +101,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode T { return container; } - __resource?.ToJson(container, serializationMode); + __proxyResource?.ToJson(container, serializationMode); AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); AfterToJson(ref container); return container; diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ChangeAnalysisIdentity.PowerShell.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ChangeAnalysisIdentity.PowerShell.cs index 289cae1d64fb..71f52f2e3bfe 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ChangeAnalysisIdentity.PowerShell.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ChangeAnalysisIdentity.PowerShell.cs @@ -53,6 +53,14 @@ public partial class ChangeAnalysisIdentity 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 . @@ -156,6 +164,18 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeAn /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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(ChangeAnalysisIdentityTypeConverter))] public partial interface IChangeAnalysisIdentity diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ChangeAnalysisIdentity.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ChangeAnalysisIdentity.cs index 8223304ea192..2d5206e451ff 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ChangeAnalysisIdentity.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ChangeAnalysisIdentity.cs @@ -53,6 +53,9 @@ public partial interface IChangeAnalysisIdentity : [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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 IChangeAnalysisIdentity : [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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 IChangeAnalysisIdentity : [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The identifier of the resource.", SerializedName = @"resourceId", PossibleTypes = new [] { typeof(string) })] @@ -77,6 +86,9 @@ public partial interface IChangeAnalysisIdentity : [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ChangeAnalysisIdentity.json.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ChangeAnalysisIdentity.json.cs index f3aae3e1bbee..59edee926bb5 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ChangeAnalysisIdentity.json.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ChangeAnalysisIdentity.json.cs @@ -64,10 +64,10 @@ internal ChangeAnalysisIdentity(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysi { return; } - {_resourceId = If( json?.PropertyT("resourceId"), out var __jsonResourceId) ? (string)__jsonResourceId : (string)ResourceId;} - {_subscriptionId = If( json?.PropertyT("subscriptionId"), out var __jsonSubscriptionId) ? (string)__jsonSubscriptionId : (string)SubscriptionId;} - {_resourceGroupName = If( json?.PropertyT("resourceGroupName"), out var __jsonResourceGroupName) ? (string)__jsonResourceGroupName : (string)ResourceGroupName;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_resourceId = If( json?.PropertyT("resourceId"), out var __jsonResourceId) ? (string)__jsonResourceId : (string)_resourceId;} + {_subscriptionId = If( json?.PropertyT("subscriptionId"), out var __jsonSubscriptionId) ? (string)__jsonSubscriptionId : (string)_subscriptionId;} + {_resourceGroupName = If( json?.PropertyT("resourceGroupName"), out var __jsonResourceGroupName) ? (string)__jsonResourceGroupName : (string)_resourceGroupName;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} AfterFromJson(json); } diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/ChangeList.PowerShell.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ChangeList.PowerShell.cs similarity index 71% rename from generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/ChangeList.PowerShell.cs rename to generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ChangeList.PowerShell.cs index a07be00b0725..754294e7c2f9 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/ChangeList.PowerShell.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ChangeList.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.ChangeAnalysis.Models.Api20210401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models { using Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.PowerShell; @@ -55,7 +55,15 @@ public partial class ChangeList 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 ChangeList(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangeListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChange[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangeListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.ChangeTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.ChangeTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangeListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangeListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeListInternal)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. @@ -95,37 +103,37 @@ internal ChangeList(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangeListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChange[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangeListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.ChangeTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.ChangeTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangeListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangeListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeListInternal)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.ChangeAnalysis.Models.Api20210401.IChangeList DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeList DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ChangeList(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.ChangeAnalysis.Models.Api20210401.IChangeList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ChangeList(content); } @@ -135,12 +143,24 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api202104 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangeList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis.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 list of detected changes. [System.ComponentModel.TypeConverter(typeof(ChangeListTypeConverter))] diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/ChangeList.TypeConverter.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ChangeList.TypeConverter.cs similarity index 97% rename from generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/ChangeList.TypeConverter.cs rename to generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ChangeList.TypeConverter.cs index 956d7c55a972..a6303df8ba5b 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/ChangeList.TypeConverter.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ChangeList.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.ChangeAnalysis.Models.Api20210401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models { using Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis.Models.Api20210401.IChangeList ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeList ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangeList).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeList).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/ChangeList.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ChangeList.cs similarity index 78% rename from generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/ChangeList.cs rename to generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ChangeList.cs index c10e682b95c2..510686745403 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/ChangeList.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ChangeList.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.ChangeAnalysis.Models.Api20210401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Extensions; /// The list of detected changes. public partial class ChangeList : - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangeList, - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangeListInternal + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeList, + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeListInternal { /// Backing field for property. @@ -21,11 +21,11 @@ public partial class ChangeList : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChange[] _value; + private System.Collections.Generic.List _value; /// The list of changes. [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Origin(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChange[] 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 ChangeList() @@ -41,6 +41,9 @@ public partial interface IChangeList : [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The URI that can be used to request the next page of changes.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -49,10 +52,13 @@ public partial interface IChangeList : [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of changes.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChange) })] - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChange[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChange) })] + System.Collections.Generic.List Value { get; set; } } /// The list of detected changes. @@ -62,7 +68,7 @@ internal partial interface IChangeListInternal /// The URI that can be used to request the next page of changes. string NextLink { get; set; } /// The list of changes. - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChange[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/ChangeList.json.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ChangeList.json.cs similarity index 91% rename from generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/ChangeList.json.cs rename to generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ChangeList.json.cs index 575098019cdc..2236198be222 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/ChangeList.json.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ChangeList.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.ChangeAnalysis.Models.Api20210401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Extensions; @@ -65,19 +65,19 @@ internal ChangeList(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Js { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis.Models.Api20210401.IChange) (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.Change.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.ChangeAnalysis.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.ChangeAnalysis.Models.IChange) (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Change.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.ChangeAnalysis.Models.Api20210401.IChangeList. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeList. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangeList. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeList. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangeList FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeList FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonObject json ? new ChangeList(json) : null; } diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/ChangeProperties.PowerShell.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ChangeProperties.PowerShell.cs similarity index 61% rename from generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/ChangeProperties.PowerShell.cs rename to generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ChangeProperties.PowerShell.cs index ea0f932a8f7a..1b0cf7b78d83 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/ChangeProperties.PowerShell.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ChangeProperties.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.ChangeAnalysis.Models.Api20210401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models { using Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.PowerShell; @@ -55,7 +55,15 @@ public partial class ChangeProperties 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 ChangeProperties(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("ResourceId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangePropertiesInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangePropertiesInternal)this).ResourceId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangePropertiesInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangePropertiesInternal)this).ResourceId, global::System.Convert.ToString); } if (content.Contains("TimeStamp")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangePropertiesInternal)this).TimeStamp = (global::System.DateTime?) content.GetValueForProperty("TimeStamp",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangePropertiesInternal)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.ChangeAnalysis.Models.IChangePropertiesInternal)this).TimeStamp = (global::System.DateTime?) content.GetValueForProperty("TimeStamp",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangePropertiesInternal)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("InitiatedByList")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangePropertiesInternal)this).InitiatedByList = (string[]) content.GetValueForProperty("InitiatedByList",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangePropertiesInternal)this).InitiatedByList, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangePropertiesInternal)this).InitiatedByList = (System.Collections.Generic.List) content.GetValueForProperty("InitiatedByList",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangePropertiesInternal)this).InitiatedByList, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("ChangeType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangePropertiesInternal)this).ChangeType = (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support.ChangeType?) content.GetValueForProperty("ChangeType",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangePropertiesInternal)this).ChangeType, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support.ChangeType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangePropertiesInternal)this).ChangeType = (string) content.GetValueForProperty("ChangeType",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangePropertiesInternal)this).ChangeType, global::System.Convert.ToString); } if (content.Contains("PropertyChange")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangePropertiesInternal)this).PropertyChange = (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IPropertyChange[]) content.GetValueForProperty("PropertyChange",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangePropertiesInternal)this).PropertyChange, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.PropertyChangeTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangePropertiesInternal)this).PropertyChange = (System.Collections.Generic.List) content.GetValueForProperty("PropertyChange",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangePropertiesInternal)this).PropertyChange, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.PropertyChangeTypeConverter.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,49 +115,49 @@ internal ChangeProperties(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("ResourceId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangePropertiesInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangePropertiesInternal)this).ResourceId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangePropertiesInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangePropertiesInternal)this).ResourceId, global::System.Convert.ToString); } if (content.Contains("TimeStamp")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangePropertiesInternal)this).TimeStamp = (global::System.DateTime?) content.GetValueForProperty("TimeStamp",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangePropertiesInternal)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.ChangeAnalysis.Models.IChangePropertiesInternal)this).TimeStamp = (global::System.DateTime?) content.GetValueForProperty("TimeStamp",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangePropertiesInternal)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("InitiatedByList")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangePropertiesInternal)this).InitiatedByList = (string[]) content.GetValueForProperty("InitiatedByList",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangePropertiesInternal)this).InitiatedByList, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangePropertiesInternal)this).InitiatedByList = (System.Collections.Generic.List) content.GetValueForProperty("InitiatedByList",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangePropertiesInternal)this).InitiatedByList, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("ChangeType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangePropertiesInternal)this).ChangeType = (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support.ChangeType?) content.GetValueForProperty("ChangeType",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangePropertiesInternal)this).ChangeType, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support.ChangeType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangePropertiesInternal)this).ChangeType = (string) content.GetValueForProperty("ChangeType",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangePropertiesInternal)this).ChangeType, global::System.Convert.ToString); } if (content.Contains("PropertyChange")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangePropertiesInternal)this).PropertyChange = (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IPropertyChange[]) content.GetValueForProperty("PropertyChange",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangePropertiesInternal)this).PropertyChange, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.PropertyChangeTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangePropertiesInternal)this).PropertyChange = (System.Collections.Generic.List) content.GetValueForProperty("PropertyChange",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangePropertiesInternal)this).PropertyChange, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.PropertyChangeTypeConverter.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.ChangeAnalysis.Models.Api20210401.IChangeProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ChangeProperties(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.ChangeAnalysis.Models.Api20210401.IChangeProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ChangeProperties(content); } @@ -159,12 +167,24 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api202104 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangeProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis.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 properties of a change. [System.ComponentModel.TypeConverter(typeof(ChangePropertiesTypeConverter))] diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/ChangeProperties.TypeConverter.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ChangeProperties.TypeConverter.cs similarity index 97% rename from generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/ChangeProperties.TypeConverter.cs rename to generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ChangeProperties.TypeConverter.cs index a60b2ee52b89..1612b4d13048 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/ChangeProperties.TypeConverter.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ChangeProperties.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.ChangeAnalysis.Models.Api20210401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models { using Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis.Models.Api20210401.IChangeProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangeProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/ChangeProperties.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ChangeProperties.cs similarity index 74% rename from generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/ChangeProperties.cs rename to generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ChangeProperties.cs index 4e3c3b9f658e..a7b19b5a3aa6 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/ChangeProperties.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ChangeProperties.cs @@ -3,39 +3,39 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Extensions; /// The properties of a change. public partial class ChangeProperties : - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangeProperties, - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangePropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeProperties, + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangePropertiesInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support.ChangeType? _changeType; + private string _changeType; /// The type of the change. [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Origin(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support.ChangeType? ChangeType { get => this._changeType; set => this._changeType = value; } + public string ChangeType { get => this._changeType; set => this._changeType = value; } /// Backing field for property. - private string[] _initiatedByList; + private System.Collections.Generic.List _initiatedByList; /// /// The list of identities who might initiated the change. /// The identity could be user name (email address) or the object ID of the Service Principal. /// [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Origin(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.PropertyOrigin.Owned)] - public string[] InitiatedByList { get => this._initiatedByList; set => this._initiatedByList = value; } + public System.Collections.Generic.List InitiatedByList { get => this._initiatedByList; set => this._initiatedByList = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IPropertyChange[] _propertyChange; + private System.Collections.Generic.List _propertyChange; /// The list of detailed changes at json property level. [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Origin(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IPropertyChange[] PropertyChange { get => this._propertyChange; set => this._propertyChange = value; } + public System.Collections.Generic.List PropertyChange { get => this._propertyChange; set => this._propertyChange = value; } /// Backing field for property. private string _resourceId; @@ -65,10 +65,14 @@ public partial interface IChangeProperties : [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of the change.", SerializedName = @"changeType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support.ChangeType) })] - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support.ChangeType? ChangeType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.PSArgumentCompleterAttribute("Add", "Remove", "Update")] + string ChangeType { get; set; } /// /// The list of identities who might initiated the change. /// The identity could be user name (email address) or the object ID of the Service Principal. @@ -76,23 +80,32 @@ public partial interface IChangeProperties : [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of identities who might initiated the change. The identity could be user name (email address) or the object ID of the Service Principal.", SerializedName = @"initiatedByList", PossibleTypes = new [] { typeof(string) })] - string[] InitiatedByList { get; set; } + System.Collections.Generic.List InitiatedByList { get; set; } /// The list of detailed changes at json property level. [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of detailed changes at json property level.", SerializedName = @"propertyChanges", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IPropertyChange) })] - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IPropertyChange[] PropertyChange { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IPropertyChange) })] + System.Collections.Generic.List PropertyChange { get; set; } /// The resource id that the change is attached to. [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The resource id that the change is attached to.", SerializedName = @"resourceId", PossibleTypes = new [] { typeof(string) })] @@ -101,6 +114,9 @@ The identity could be user name (email address) or the object ID of the Service [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The time when the change is detected.", SerializedName = @"timeStamp", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -112,14 +128,15 @@ internal partial interface IChangePropertiesInternal { /// The type of the change. - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support.ChangeType? ChangeType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.PSArgumentCompleterAttribute("Add", "Remove", "Update")] + string ChangeType { get; set; } /// /// The list of identities who might initiated the change. /// The identity could be user name (email address) or the object ID of the Service Principal. /// - string[] InitiatedByList { get; set; } + System.Collections.Generic.List InitiatedByList { get; set; } /// The list of detailed changes at json property level. - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IPropertyChange[] PropertyChange { get; set; } + System.Collections.Generic.List PropertyChange { get; set; } /// The resource id that the change is attached to. string ResourceId { get; set; } /// The time when the change is detected. diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/ChangeProperties.json.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ChangeProperties.json.cs similarity index 90% rename from generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/ChangeProperties.json.cs rename to generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ChangeProperties.json.cs index 66cf7192d74f..e63d5474366e 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/ChangeProperties.json.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ChangeProperties.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.ChangeAnalysis.Models.Api20210401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Extensions; @@ -65,22 +65,22 @@ internal ChangeProperties(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runt { return; } - {_resourceId = If( json?.PropertyT("resourceId"), out var __jsonResourceId) ? (string)__jsonResourceId : (string)ResourceId;} - {_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;} - {_initiatedByList = If( json?.PropertyT("initiatedByList"), out var __jsonInitiatedByList) ? If( __jsonInitiatedByList as Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : InitiatedByList;} - {_changeType = If( json?.PropertyT("changeType"), out var __jsonChangeType) ? (string)__jsonChangeType : (string)ChangeType;} - {_propertyChange = If( json?.PropertyT("propertyChanges"), out var __jsonPropertyChanges) ? If( __jsonPropertyChanges as Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis.Models.Api20210401.IPropertyChange) (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.PropertyChange.FromJson(__p) )) ))() : null : PropertyChange;} + {_resourceId = If( json?.PropertyT("resourceId"), out var __jsonResourceId) ? (string)__jsonResourceId : (string)_resourceId;} + {_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;} + {_initiatedByList = If( json?.PropertyT("initiatedByList"), out var __jsonInitiatedByList) ? If( __jsonInitiatedByList as Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _initiatedByList;} + {_changeType = If( json?.PropertyT("changeType"), out var __jsonChangeType) ? (string)__jsonChangeType : (string)_changeType;} + {_propertyChange = If( json?.PropertyT("propertyChanges"), out var __jsonPropertyChanges) ? If( __jsonPropertyChanges as Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis.Models.IPropertyChange) (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.PropertyChange.FromJson(__p) )) ))() : null : _propertyChange;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangeProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangeProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChangeProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonObject json ? new ChangeProperties(json) : null; } diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20/ErrorAdditionalInfo.PowerShell.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ErrorAdditionalInfo.PowerShell.cs similarity index 72% rename from generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20/ErrorAdditionalInfo.PowerShell.cs rename to generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ErrorAdditionalInfo.PowerShell.cs index 501a9967cbad..dce8a55ef2f6 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20/ErrorAdditionalInfo.PowerShell.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.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.ChangeAnalysis.Models.Api20 +namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models { using Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.PowerShell; @@ -55,33 +55,41 @@ public partial class ErrorAdditionalInfo 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.ChangeAnalysis.Models.Api20.IErrorAdditionalInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis.Models.Api20.IErrorAdditionalInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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. @@ -96,17 +104,17 @@ internal ErrorAdditionalInfo(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorAdditionalInfoInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorAdditionalInfoInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorAdditionalInfoInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorAdditionalInfoInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Info")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorAdditionalInfoInternal)this).Info = (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IAny) content.GetValueForProperty("Info",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorAdditionalInfoInternal)this).Info, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.AnyTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorAdditionalInfoInternal)this).Info = (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IAny) content.GetValueForProperty("Info",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorAdditionalInfoInternal)this).Info, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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. @@ -121,11 +129,11 @@ internal ErrorAdditionalInfo(global::System.Management.Automation.PSObject conte // actually deserialize if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorAdditionalInfoInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorAdditionalInfoInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorAdditionalInfoInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorAdditionalInfoInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Info")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorAdditionalInfoInternal)this).Info = (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IAny) content.GetValueForProperty("Info",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorAdditionalInfoInternal)this).Info, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.AnyTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorAdditionalInfoInternal)this).Info = (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IAny) content.GetValueForProperty("Info",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorAdditionalInfoInternal)this).Info, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.AnyTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } @@ -135,12 +143,24 @@ 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.ChangeAnalysis.Models.Api20.IErrorAdditionalInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorAdditionalInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis.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 resource management error additional info. [System.ComponentModel.TypeConverter(typeof(ErrorAdditionalInfoTypeConverter))] diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20/ErrorAdditionalInfo.TypeConverter.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ErrorAdditionalInfo.TypeConverter.cs similarity index 97% rename from generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20/ErrorAdditionalInfo.TypeConverter.cs rename to generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ErrorAdditionalInfo.TypeConverter.cs index 2b07d5c6d490..1cb101467b85 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20/ErrorAdditionalInfo.TypeConverter.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.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.ChangeAnalysis.Models.Api20 +namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models { using Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis.Models.Api20.IErrorAdditionalInfo ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorAdditionalInfo ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorAdditionalInfo).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorAdditionalInfo).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20/ErrorAdditionalInfo.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ErrorAdditionalInfo.cs similarity index 86% rename from generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20/ErrorAdditionalInfo.cs rename to generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ErrorAdditionalInfo.cs index f814c7002b73..8e96f243c6a8 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20/ErrorAdditionalInfo.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.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.ChangeAnalysis.Models.Api20 +namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Extensions; /// The resource management error additional info. public partial class ErrorAdditionalInfo : - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorAdditionalInfo, - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorAdditionalInfoInternal + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorAdditionalInfo, + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorAdditionalInfoInternal { /// Backing field for property. @@ -21,10 +21,10 @@ public partial class ErrorAdditionalInfo : public Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IAny Info { get => (this._info = this._info ?? new Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Any()); } /// Internal Acessors for Info - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IAny Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorAdditionalInfoInternal.Info { get => (this._info = this._info ?? new Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Any()); set { {_info = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IAny Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorAdditionalInfoInternal.Info { get => (this._info = this._info ?? new Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Any()); set { {_info = value;} } } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorAdditionalInfoInternal.Type { get => this._type; set { {_type = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis.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.ChangeAnalysis.Models.IAny) })] @@ -55,6 +58,9 @@ public partial interface IErrorAdditionalInfo : [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20/ErrorAdditionalInfo.json.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ErrorAdditionalInfo.json.cs similarity index 94% rename from generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20/ErrorAdditionalInfo.json.cs rename to generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ErrorAdditionalInfo.json.cs index cb73d929f225..8185f8c28cd6 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20/ErrorAdditionalInfo.json.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.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.ChangeAnalysis.Models.Api20 +namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Extensions; @@ -65,19 +65,19 @@ internal ErrorAdditionalInfo(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.R { 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.ChangeAnalysis.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.ChangeAnalysis.Models.Any.FromJson(__jsonInfo) : _info;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorAdditionalInfo. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorAdditionalInfo. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorAdditionalInfo. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorAdditionalInfo. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorAdditionalInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorAdditionalInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonObject json ? new ErrorAdditionalInfo(json) : null; } @@ -101,11 +101,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode T { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._info ? (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode) this._info.ToJson(null,serializationMode) : null, "info" ,container.Add ); } diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20/ErrorDetail.PowerShell.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ErrorDetail.PowerShell.cs similarity index 62% rename from generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20/ErrorDetail.PowerShell.cs rename to generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ErrorDetail.PowerShell.cs index fdc60340fe0b..c2da5b77ac79 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20/ErrorDetail.PowerShell.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ErrorDetail.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20 +namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models { using Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.PowerShell; @@ -55,33 +55,41 @@ public partial class ErrorDetail 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.ChangeAnalysis.Models.Api20.IErrorDetail DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorDetail DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ErrorDetail(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetail DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorDetail DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ErrorDetail(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -96,29 +104,29 @@ internal ErrorDetail(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetailInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetailInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorDetailInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorDetailInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetailInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetailInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorDetailInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorDetailInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetailInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetailInternal)this).Target, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorDetailInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorDetailInternal)this).Target, global::System.Convert.ToString); } if (content.Contains("Detail")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetailInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetail[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetailInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.ErrorDetailTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorDetailInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorDetailInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.ErrorDetailTypeConverter.ConvertFrom)); } if (content.Contains("AdditionalInfo")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetailInternal)this).AdditionalInfo = (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorAdditionalInfo[]) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetailInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorDetailInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorDetailInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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. @@ -133,23 +141,23 @@ internal ErrorDetail(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetailInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetailInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorDetailInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorDetailInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetailInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetailInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorDetailInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorDetailInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetailInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetailInternal)this).Target, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorDetailInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorDetailInternal)this).Target, global::System.Convert.ToString); } if (content.Contains("Detail")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetailInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetail[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetailInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.ErrorDetailTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorDetailInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorDetailInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.ErrorDetailTypeConverter.ConvertFrom)); } if (content.Contains("AdditionalInfo")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetailInternal)this).AdditionalInfo = (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorAdditionalInfo[]) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetailInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorDetailInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorDetailInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } @@ -159,12 +167,24 @@ internal ErrorDetail(global::System.Management.Automation.PSObject content) /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetail FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorDetail FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis.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 error detail. [System.ComponentModel.TypeConverter(typeof(ErrorDetailTypeConverter))] diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20/ErrorDetail.TypeConverter.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ErrorDetail.TypeConverter.cs similarity index 98% rename from generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20/ErrorDetail.TypeConverter.cs rename to generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ErrorDetail.TypeConverter.cs index c364fc9950e0..5a3aa2279cda 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20/ErrorDetail.TypeConverter.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ErrorDetail.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20 +namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models { using Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis.Models.Api20.IErrorDetail ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorDetail ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetail).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorDetail).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20/ErrorDetail.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ErrorDetail.cs similarity index 68% rename from generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20/ErrorDetail.cs rename to generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ErrorDetail.cs index 6737c40505d6..206c2bc36680 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20/ErrorDetail.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ErrorDetail.cs @@ -3,22 +3,22 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20 +namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Extensions; /// The error detail. public partial class ErrorDetail : - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetail, - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetailInternal + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorDetail, + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorDetailInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorAdditionalInfo[] _additionalInfo; + private System.Collections.Generic.List _additionalInfo; /// The error additional info. [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Origin(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorAdditionalInfo[] AdditionalInfo { get => this._additionalInfo; } + public System.Collections.Generic.List AdditionalInfo { get => this._additionalInfo; } /// Backing field for property. private string _code; @@ -28,11 +28,11 @@ public partial class ErrorDetail : public string Code { get => this._code; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetail[] _detail; + private System.Collections.Generic.List _detail; /// The error details. [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Origin(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetail[] Detail { get => this._detail; } + public System.Collections.Generic.List Detail { get => this._detail; } /// Backing field for property. private string _message; @@ -42,19 +42,19 @@ public partial class ErrorDetail : public string Message { get => this._message; } /// Internal Acessors for AdditionalInfo - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorAdditionalInfo[] Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetailInternal.AdditionalInfo { get => this._additionalInfo; set { {_additionalInfo = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorDetailInternal.AdditionalInfo { get => this._additionalInfo; set { {_additionalInfo = value;} } } /// Internal Acessors for Code - string Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetailInternal.Code { get => this._code; set { {_code = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorDetailInternal.Code { get => this._code; set { {_code = value;} } } /// Internal Acessors for Detail - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetail[] Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetailInternal.Detail { get => this._detail; set { {_detail = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorDetailInternal.Detail { get => this._detail; set { {_detail = value;} } } /// Internal Acessors for Message - string Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetailInternal.Message { get => this._message; set { {_message = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorDetailInternal.Message { get => this._message; set { {_message = value;} } } /// Internal Acessors for Target - string Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetailInternal.Target { get => this._target; set { {_target = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorDetailInternal.Target { get => this._target; set { {_target = value;} } } /// Backing field for property. private string _target; @@ -77,14 +77,20 @@ public partial interface IErrorDetail : [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis.Models.Api20.IErrorAdditionalInfo) })] - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorAdditionalInfo[] AdditionalInfo { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorAdditionalInfo) })] + System.Collections.Generic.List AdditionalInfo { get; } /// The error code. [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The error code.", SerializedName = @"code", PossibleTypes = new [] { typeof(string) })] @@ -93,14 +99,20 @@ public partial interface IErrorDetail : [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis.Models.Api20.IErrorDetail) })] - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetail[] Detail { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorDetail) })] + System.Collections.Generic.List Detail { get; } /// The error message. [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The error message.", SerializedName = @"message", PossibleTypes = new [] { typeof(string) })] @@ -109,6 +121,9 @@ public partial interface IErrorDetail : [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The error target.", SerializedName = @"target", PossibleTypes = new [] { typeof(string) })] @@ -120,11 +135,11 @@ internal partial interface IErrorDetailInternal { /// The error additional info. - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorAdditionalInfo[] AdditionalInfo { get; set; } + System.Collections.Generic.List AdditionalInfo { get; set; } /// The error code. string Code { get; set; } /// The error details. - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetail[] Detail { get; set; } + System.Collections.Generic.List Detail { get; set; } /// The error message. string Message { get; set; } /// The error target. diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20/ErrorDetail.json.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ErrorDetail.json.cs similarity index 87% rename from generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20/ErrorDetail.json.cs rename to generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ErrorDetail.json.cs index 563a88818d9a..0264ec626825 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20/ErrorDetail.json.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ErrorDetail.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20 +namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Extensions; @@ -65,22 +65,22 @@ internal ErrorDetail(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.J { 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.ChangeAnalysis.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.ChangeAnalysis.Models.Api20.IErrorDetail) (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.ErrorDetail.FromJson(__u) )) ))() : null : Detail;} - {_additionalInfo = If( json?.PropertyT("additionalInfo"), out var __jsonAdditionalInfo) ? If( __jsonAdditionalInfo as Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis.Models.Api20.IErrorAdditionalInfo) (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.ErrorAdditionalInfo.FromJson(__p) )) ))() : null : AdditionalInfo;} + {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)_code;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)_message;} + {_target = If( json?.PropertyT("target"), out var __jsonTarget) ? (string)__jsonTarget : (string)_target;} + {_detail = If( json?.PropertyT("details"), out var __jsonDetails) ? If( __jsonDetails as Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis.Models.IErrorDetail) (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.ErrorDetail.FromJson(__u) )) ))() : null : _detail;} + {_additionalInfo = If( json?.PropertyT("additionalInfo"), out var __jsonAdditionalInfo) ? If( __jsonAdditionalInfo as Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis.Models.IErrorAdditionalInfo) (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.ErrorAdditionalInfo.FromJson(__p) )) ))() : null : _additionalInfo;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetail. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorDetail. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetail. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorDetail. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetail FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorDetail FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonObject json ? new ErrorDetail(json) : null; } @@ -104,19 +104,19 @@ public Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode T { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._code)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonString(this._code.ToString()) : null, "code" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonString(this._message.ToString()) : null, "message" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._target)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonString(this._target.ToString()) : null, "target" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.SerializationMode.IncludeRead)) { if (null != this._detail) { @@ -128,7 +128,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode T container.Add("details",__w); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.SerializationMode.IncludeRead)) { if (null != this._additionalInfo) { diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20/ErrorResponse.PowerShell.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ErrorResponse.PowerShell.cs similarity index 60% rename from generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20/ErrorResponse.PowerShell.cs rename to generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ErrorResponse.PowerShell.cs index 8f79b798866b..184335c0c49e 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20/ErrorResponse.PowerShell.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.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.ChangeAnalysis.Models.Api20 +namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models { using Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.PowerShell; @@ -58,33 +58,41 @@ public partial class ErrorResponse 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.ChangeAnalysis.Models.Api20.IErrorResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis.Models.Api20.IErrorResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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. @@ -99,33 +107,33 @@ internal ErrorResponse(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Error")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.ErrorDetailTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.ErrorDetailTypeConverter.ConvertFrom); } if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorResponseInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorResponseInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorResponseInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorResponseInternal)this).Target, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorResponseInternal)this).Target, global::System.Convert.ToString); } if (content.Contains("Detail")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorResponseInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetail[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.ErrorDetailTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.ErrorDetailTypeConverter.ConvertFrom)); } if (content.Contains("AdditionalInfo")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorResponseInternal)this).AdditionalInfo = (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorAdditionalInfo[]) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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. @@ -140,27 +148,27 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Error")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.ErrorDetailTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.ErrorDetailTypeConverter.ConvertFrom); } if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorResponseInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorResponseInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorResponseInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorResponseInternal)this).Target, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorResponseInternal)this).Target, global::System.Convert.ToString); } if (content.Contains("Detail")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorResponseInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetail[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.ErrorDetailTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.ErrorDetailTypeConverter.ConvertFrom)); } if (content.Contains("AdditionalInfo")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorResponseInternal)this).AdditionalInfo = (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorAdditionalInfo[]) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } @@ -170,12 +178,24 @@ 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.ChangeAnalysis.Models.Api20.IErrorResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis.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(); + } } /// Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows /// the OData error response format.). diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20/ErrorResponse.TypeConverter.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ErrorResponse.TypeConverter.cs similarity index 98% rename from generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20/ErrorResponse.TypeConverter.cs rename to generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ErrorResponse.TypeConverter.cs index d4fb2a090230..0c15c5e46c03 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20/ErrorResponse.TypeConverter.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.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.ChangeAnalysis.Models.Api20 +namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models { using Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis.Models.Api20.IErrorResponse ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorResponse ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorResponse).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorResponse).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20/ErrorResponse.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ErrorResponse.cs similarity index 60% rename from generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20/ErrorResponse.cs rename to generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ErrorResponse.cs index 72dd51817ba0..078ef1b37ef8 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20/ErrorResponse.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.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.ChangeAnalysis.Models.Api20 +namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Extensions; @@ -12,54 +12,54 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20 /// the OData error response format.). /// public partial class ErrorResponse : - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorResponse, - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorResponseInternal + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorResponse, + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorResponseInternal { /// The error additional info. [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Origin(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorAdditionalInfo[] AdditionalInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetailInternal)Error).AdditionalInfo; } + public System.Collections.Generic.List AdditionalInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorDetailInternal)Error).AdditionalInfo; } /// The error code. [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Origin(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.PropertyOrigin.Inlined)] - public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetailInternal)Error).Code; } + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorDetailInternal)Error).Code; } /// The error details. [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Origin(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetail[] Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetailInternal)Error).Detail; } + public System.Collections.Generic.List Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorDetailInternal)Error).Detail; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetail _error; + private Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorDetail _error; /// The error object. [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Origin(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetail Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.ErrorDetail()); set => this._error = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorDetail Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.ErrorDetail()); set => this._error = value; } /// The error message. [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Origin(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.PropertyOrigin.Inlined)] - public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetailInternal)Error).Message; } + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorDetailInternal)Error).Message; } /// Internal Acessors for AdditionalInfo - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorAdditionalInfo[] Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorResponseInternal.AdditionalInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetailInternal)Error).AdditionalInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetailInternal)Error).AdditionalInfo = value; } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorResponseInternal.AdditionalInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorDetailInternal)Error).AdditionalInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorDetailInternal)Error).AdditionalInfo = value; } /// Internal Acessors for Code - string Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorResponseInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetailInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetailInternal)Error).Code = value; } + string Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorResponseInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorDetailInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorDetailInternal)Error).Code = value; } /// Internal Acessors for Detail - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetail[] Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorResponseInternal.Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetailInternal)Error).Detail; set => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetailInternal)Error).Detail = value; } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorResponseInternal.Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorDetailInternal)Error).Detail; set => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorDetailInternal)Error).Detail = value; } /// Internal Acessors for Error - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetail Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorResponseInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.ErrorDetail()); set { {_error = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorDetail Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorResponseInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.ErrorDetail()); set { {_error = value;} } } /// Internal Acessors for Message - string Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorResponseInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetailInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetailInternal)Error).Message = value; } + string Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorResponseInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorDetailInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorDetailInternal)Error).Message = value; } /// Internal Acessors for Target - string Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorResponseInternal.Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetailInternal)Error).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetailInternal)Error).Target = value; } + string Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorResponseInternal.Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorDetailInternal)Error).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorDetailInternal)Error).Target = value; } /// The error target. [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Origin(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.PropertyOrigin.Inlined)] - public string Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetailInternal)Error).Target; } + public string Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorDetailInternal)Error).Target; } /// Creates an new instance. public ErrorResponse() @@ -76,14 +76,20 @@ public partial interface IErrorResponse : [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis.Models.Api20.IErrorAdditionalInfo) })] - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorAdditionalInfo[] AdditionalInfo { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorAdditionalInfo) })] + System.Collections.Generic.List AdditionalInfo { get; } /// The error code. [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The error code.", SerializedName = @"code", PossibleTypes = new [] { typeof(string) })] @@ -92,14 +98,20 @@ public partial interface IErrorResponse : [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis.Models.Api20.IErrorDetail) })] - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetail[] Detail { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorDetail) })] + System.Collections.Generic.List Detail { get; } /// The error message. [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The error message.", SerializedName = @"message", PossibleTypes = new [] { typeof(string) })] @@ -108,6 +120,9 @@ public partial interface IErrorResponse : [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The error target.", SerializedName = @"target", PossibleTypes = new [] { typeof(string) })] @@ -120,13 +135,13 @@ internal partial interface IErrorResponseInternal { /// The error additional info. - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorAdditionalInfo[] AdditionalInfo { get; set; } + System.Collections.Generic.List AdditionalInfo { get; set; } /// The error code. string Code { get; set; } /// The error details. - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetail[] Detail { get; set; } + System.Collections.Generic.List Detail { get; set; } /// The error object. - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorDetail Error { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorDetail Error { get; set; } /// The error message. string Message { get; set; } /// The error target. diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20/ErrorResponse.json.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ErrorResponse.json.cs similarity index 95% rename from generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20/ErrorResponse.json.cs rename to generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ErrorResponse.json.cs index d9f4619b7e05..421614db6afc 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20/ErrorResponse.json.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.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.ChangeAnalysis.Models.Api20 +namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Extensions; @@ -68,18 +68,18 @@ internal ErrorResponse(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime { return; } - {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.ErrorDetail.FromJson(__jsonError) : Error;} + {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.ErrorDetail.FromJson(__jsonError) : _error;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorResponse. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorResponse. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorResponse. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorResponse. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonObject json ? new ErrorResponse(json) : null; } diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/PropertyChange.PowerShell.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/PropertyChange.PowerShell.cs similarity index 59% rename from generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/PropertyChange.PowerShell.cs rename to generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/PropertyChange.PowerShell.cs index 92c421f672b0..e8807ed76764 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/PropertyChange.PowerShell.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/PropertyChange.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.ChangeAnalysis.Models.Api20210401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models { using Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class PropertyChange 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.ChangeAnalysis.Models.Api20210401.IPropertyChange DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IPropertyChange DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new PropertyChange(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.ChangeAnalysis.Models.Api20210401.IPropertyChange DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IPropertyChange DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new PropertyChange(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api202104 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IPropertyChange FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IPropertyChange FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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. @@ -103,45 +111,45 @@ internal PropertyChange(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("ChangeType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IPropertyChangeInternal)this).ChangeType = (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support.ChangeType?) content.GetValueForProperty("ChangeType",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IPropertyChangeInternal)this).ChangeType, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support.ChangeType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IPropertyChangeInternal)this).ChangeType = (string) content.GetValueForProperty("ChangeType",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IPropertyChangeInternal)this).ChangeType, global::System.Convert.ToString); } if (content.Contains("ChangeCategory")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IPropertyChangeInternal)this).ChangeCategory = (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support.ChangeCategory?) content.GetValueForProperty("ChangeCategory",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IPropertyChangeInternal)this).ChangeCategory, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support.ChangeCategory.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IPropertyChangeInternal)this).ChangeCategory = (string) content.GetValueForProperty("ChangeCategory",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IPropertyChangeInternal)this).ChangeCategory, global::System.Convert.ToString); } if (content.Contains("JsonPath")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IPropertyChangeInternal)this).JsonPath = (string) content.GetValueForProperty("JsonPath",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IPropertyChangeInternal)this).JsonPath, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IPropertyChangeInternal)this).JsonPath = (string) content.GetValueForProperty("JsonPath",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IPropertyChangeInternal)this).JsonPath, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IPropertyChangeInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IPropertyChangeInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IPropertyChangeInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IPropertyChangeInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("Level")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IPropertyChangeInternal)this).Level = (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support.Level?) content.GetValueForProperty("Level",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IPropertyChangeInternal)this).Level, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support.Level.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IPropertyChangeInternal)this).Level = (string) content.GetValueForProperty("Level",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IPropertyChangeInternal)this).Level, global::System.Convert.ToString); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IPropertyChangeInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IPropertyChangeInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IPropertyChangeInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IPropertyChangeInternal)this).Description, global::System.Convert.ToString); } if (content.Contains("OldValue")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IPropertyChangeInternal)this).OldValue = (string) content.GetValueForProperty("OldValue",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IPropertyChangeInternal)this).OldValue, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IPropertyChangeInternal)this).OldValue = (string) content.GetValueForProperty("OldValue",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IPropertyChangeInternal)this).OldValue, global::System.Convert.ToString); } if (content.Contains("NewValue")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IPropertyChangeInternal)this).NewValue = (string) content.GetValueForProperty("NewValue",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IPropertyChangeInternal)this).NewValue, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IPropertyChangeInternal)this).NewValue = (string) content.GetValueForProperty("NewValue",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IPropertyChangeInternal)this).NewValue, global::System.Convert.ToString); } if (content.Contains("IsDataMasked")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IPropertyChangeInternal)this).IsDataMasked = (bool?) content.GetValueForProperty("IsDataMasked",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IPropertyChangeInternal)this).IsDataMasked, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IPropertyChangeInternal)this).IsDataMasked = (bool?) content.GetValueForProperty("IsDataMasked",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IPropertyChangeInternal)this).IsDataMasked, (__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,39 +164,39 @@ internal PropertyChange(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("ChangeType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IPropertyChangeInternal)this).ChangeType = (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support.ChangeType?) content.GetValueForProperty("ChangeType",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IPropertyChangeInternal)this).ChangeType, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support.ChangeType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IPropertyChangeInternal)this).ChangeType = (string) content.GetValueForProperty("ChangeType",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IPropertyChangeInternal)this).ChangeType, global::System.Convert.ToString); } if (content.Contains("ChangeCategory")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IPropertyChangeInternal)this).ChangeCategory = (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support.ChangeCategory?) content.GetValueForProperty("ChangeCategory",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IPropertyChangeInternal)this).ChangeCategory, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support.ChangeCategory.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IPropertyChangeInternal)this).ChangeCategory = (string) content.GetValueForProperty("ChangeCategory",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IPropertyChangeInternal)this).ChangeCategory, global::System.Convert.ToString); } if (content.Contains("JsonPath")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IPropertyChangeInternal)this).JsonPath = (string) content.GetValueForProperty("JsonPath",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IPropertyChangeInternal)this).JsonPath, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IPropertyChangeInternal)this).JsonPath = (string) content.GetValueForProperty("JsonPath",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IPropertyChangeInternal)this).JsonPath, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IPropertyChangeInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IPropertyChangeInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IPropertyChangeInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IPropertyChangeInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("Level")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IPropertyChangeInternal)this).Level = (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support.Level?) content.GetValueForProperty("Level",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IPropertyChangeInternal)this).Level, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support.Level.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IPropertyChangeInternal)this).Level = (string) content.GetValueForProperty("Level",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IPropertyChangeInternal)this).Level, global::System.Convert.ToString); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IPropertyChangeInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IPropertyChangeInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IPropertyChangeInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IPropertyChangeInternal)this).Description, global::System.Convert.ToString); } if (content.Contains("OldValue")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IPropertyChangeInternal)this).OldValue = (string) content.GetValueForProperty("OldValue",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IPropertyChangeInternal)this).OldValue, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IPropertyChangeInternal)this).OldValue = (string) content.GetValueForProperty("OldValue",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IPropertyChangeInternal)this).OldValue, global::System.Convert.ToString); } if (content.Contains("NewValue")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IPropertyChangeInternal)this).NewValue = (string) content.GetValueForProperty("NewValue",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IPropertyChangeInternal)this).NewValue, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IPropertyChangeInternal)this).NewValue = (string) content.GetValueForProperty("NewValue",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IPropertyChangeInternal)this).NewValue, global::System.Convert.ToString); } if (content.Contains("IsDataMasked")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IPropertyChangeInternal)this).IsDataMasked = (bool?) content.GetValueForProperty("IsDataMasked",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IPropertyChangeInternal)this).IsDataMasked, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IPropertyChangeInternal)this).IsDataMasked = (bool?) content.GetValueForProperty("IsDataMasked",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IPropertyChangeInternal)this).IsDataMasked, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializePSObject(content); } @@ -197,6 +205,18 @@ internal PropertyChange(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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(); + } } /// Data of a property change. [System.ComponentModel.TypeConverter(typeof(PropertyChangeTypeConverter))] diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/PropertyChange.TypeConverter.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/PropertyChange.TypeConverter.cs similarity index 97% rename from generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/PropertyChange.TypeConverter.cs rename to generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/PropertyChange.TypeConverter.cs index 5a4a6a711e14..5a28319fc55d 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/PropertyChange.TypeConverter.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/PropertyChange.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.ChangeAnalysis.Models.Api20210401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models { using Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis.Models.Api20210401.IPropertyChange ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IPropertyChange ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IPropertyChange).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IPropertyChange).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/PropertyChange.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/PropertyChange.cs similarity index 81% rename from generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/PropertyChange.cs rename to generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/PropertyChange.cs index 41c24740379c..e0dafd689153 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/PropertyChange.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/PropertyChange.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.ChangeAnalysis.Models.Api20210401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Extensions; /// Data of a property change. public partial class PropertyChange : - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IPropertyChange, - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IPropertyChangeInternal + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IPropertyChange, + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IPropertyChangeInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support.ChangeCategory? _changeCategory; + private string _changeCategory; /// The change category. [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Origin(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support.ChangeCategory? ChangeCategory { get => this._changeCategory; set => this._changeCategory = value; } + public string ChangeCategory { get => this._changeCategory; set => this._changeCategory = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support.ChangeType? _changeType; + private string _changeType; /// The type of the change. [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Origin(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support.ChangeType? ChangeType { get => this._changeType; set => this._changeType = value; } + public string ChangeType { get => this._changeType; set => this._changeType = value; } /// Backing field for property. private string _description; @@ -62,10 +62,10 @@ public partial class PropertyChange : public string JsonPath { get => this._jsonPath; set => this._jsonPath = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support.Level? _level; + private string _level; [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Origin(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support.Level? Level { get => this._level; set => this._level = value; } + public string Level { get => this._level; set => this._level = value; } /// Backing field for property. private string _newValue; @@ -95,22 +95,33 @@ public partial interface IPropertyChange : [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The change category.", SerializedName = @"changeCategory", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support.ChangeCategory) })] - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support.ChangeCategory? ChangeCategory { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.PSArgumentCompleterAttribute("User", "System")] + string ChangeCategory { get; set; } /// The type of the change. [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of the change.", SerializedName = @"changeType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support.ChangeType) })] - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support.ChangeType? ChangeType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.PSArgumentCompleterAttribute("Add", "Remove", "Update")] + string ChangeType { get; set; } /// The description of the changed property. [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The description of the changed property.", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -122,6 +133,9 @@ public partial interface IPropertyChange : [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The enhanced display name of the json path. E.g., the json path value[0].properties will be translated to something meaningful like slots[""Staging""].properties.", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -133,6 +147,9 @@ public partial interface IPropertyChange : [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The boolean indicating whether the oldValue and newValue are masked. The values are masked if it contains sensitive information that the user doesn't have access to.", SerializedName = @"isDataMasked", PossibleTypes = new [] { typeof(bool) })] @@ -141,6 +158,9 @@ public partial interface IPropertyChange : [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The json path of the changed property.", SerializedName = @"jsonPath", PossibleTypes = new [] { typeof(string) })] @@ -149,14 +169,21 @@ public partial interface IPropertyChange : [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"", SerializedName = @"level", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support.Level) })] - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support.Level? Level { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.PSArgumentCompleterAttribute("Noisy", "Normal", "Important")] + string Level { get; set; } /// The value of the property after the change. [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The value of the property after the change.", SerializedName = @"newValue", PossibleTypes = new [] { typeof(string) })] @@ -165,6 +192,9 @@ public partial interface IPropertyChange : [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The value of the property before the change.", SerializedName = @"oldValue", PossibleTypes = new [] { typeof(string) })] @@ -176,9 +206,11 @@ internal partial interface IPropertyChangeInternal { /// The change category. - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support.ChangeCategory? ChangeCategory { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.PSArgumentCompleterAttribute("User", "System")] + string ChangeCategory { get; set; } /// The type of the change. - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support.ChangeType? ChangeType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.PSArgumentCompleterAttribute("Add", "Remove", "Update")] + string ChangeType { get; set; } /// The description of the changed property. string Description { get; set; } /// @@ -194,7 +226,8 @@ internal partial interface IPropertyChangeInternal /// The json path of the changed property. string JsonPath { get; set; } - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support.Level? Level { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.PSArgumentCompleterAttribute("Noisy", "Normal", "Important")] + string Level { get; set; } /// The value of the property after the change. string NewValue { get; set; } /// The value of the property before the change. diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/PropertyChange.json.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/PropertyChange.json.cs similarity index 95% rename from generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/PropertyChange.json.cs rename to generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/PropertyChange.json.cs index f92bf7598ee7..cff3d0ab5c08 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/PropertyChange.json.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/PropertyChange.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.ChangeAnalysis.Models.Api20210401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class PropertyChange partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IPropertyChange. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IPropertyChange. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IPropertyChange. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IPropertyChange. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IPropertyChange FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IPropertyChange FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonObject json ? new PropertyChange(json) : null; } @@ -77,15 +77,15 @@ internal PropertyChange(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtim { return; } - {_changeType = If( json?.PropertyT("changeType"), out var __jsonChangeType) ? (string)__jsonChangeType : (string)ChangeType;} - {_changeCategory = If( json?.PropertyT("changeCategory"), out var __jsonChangeCategory) ? (string)__jsonChangeCategory : (string)ChangeCategory;} - {_jsonPath = If( json?.PropertyT("jsonPath"), out var __jsonJsonPath) ? (string)__jsonJsonPath : (string)JsonPath;} - {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} - {_level = If( json?.PropertyT("level"), out var __jsonLevel) ? (string)__jsonLevel : (string)Level;} - {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} - {_oldValue = If( json?.PropertyT("oldValue"), out var __jsonOldValue) ? (string)__jsonOldValue : (string)OldValue;} - {_newValue = If( json?.PropertyT("newValue"), out var __jsonNewValue) ? (string)__jsonNewValue : (string)NewValue;} - {_isDataMasked = If( json?.PropertyT("isDataMasked"), out var __jsonIsDataMasked) ? (bool?)__jsonIsDataMasked : IsDataMasked;} + {_changeType = If( json?.PropertyT("changeType"), out var __jsonChangeType) ? (string)__jsonChangeType : (string)_changeType;} + {_changeCategory = If( json?.PropertyT("changeCategory"), out var __jsonChangeCategory) ? (string)__jsonChangeCategory : (string)_changeCategory;} + {_jsonPath = If( json?.PropertyT("jsonPath"), out var __jsonJsonPath) ? (string)__jsonJsonPath : (string)_jsonPath;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)_displayName;} + {_level = If( json?.PropertyT("level"), out var __jsonLevel) ? (string)__jsonLevel : (string)_level;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)_description;} + {_oldValue = If( json?.PropertyT("oldValue"), out var __jsonOldValue) ? (string)__jsonOldValue : (string)_oldValue;} + {_newValue = If( json?.PropertyT("newValue"), out var __jsonNewValue) ? (string)__jsonNewValue : (string)_newValue;} + {_isDataMasked = If( json?.PropertyT("isDataMasked"), out var __jsonIsDataMasked) ? (bool?)__jsonIsDataMasked : _isDataMasked;} AfterFromJson(json); } diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20/ProxyResource.PowerShell.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ProxyResource.PowerShell.cs similarity index 73% rename from generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20/ProxyResource.PowerShell.cs rename to generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ProxyResource.PowerShell.cs index 9b424a5d201d..71d981f8b2eb 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20/ProxyResource.PowerShell.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ProxyResource.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.ChangeAnalysis.Models.Api20 +namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models { using Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.PowerShell; @@ -57,27 +57,35 @@ public partial class ProxyResource 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.ChangeAnalysis.Models.Api20.IProxyResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IProxyResource DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ProxyResource(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.ChangeAnalysis.Models.Api20.IProxyResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IProxyResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ProxyResource(content); } @@ -87,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IPr /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IProxyResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IProxyResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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 ProxyResource(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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. @@ -134,15 +142,15 @@ internal ProxyResource(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -151,6 +159,18 @@ internal ProxyResource(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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 resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location [System.ComponentModel.TypeConverter(typeof(ProxyResourceTypeConverter))] diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20/ProxyResource.TypeConverter.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ProxyResource.TypeConverter.cs similarity index 98% rename from generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20/ProxyResource.TypeConverter.cs rename to generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ProxyResource.TypeConverter.cs index 57b8a8de0154..886938283979 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20/ProxyResource.TypeConverter.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ProxyResource.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.ChangeAnalysis.Models.Api20 +namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models { using Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis.Models.Api20.IProxyResource ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IProxyResource ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IProxyResource).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IProxyResource).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20/ProxyResource.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ProxyResource.cs similarity index 75% rename from generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20/ProxyResource.cs rename to generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ProxyResource.cs index 91210f88636a..3f1582401f97 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20/ProxyResource.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ProxyResource.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20 +namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Extensions; @@ -11,40 +11,39 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20 /// The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location /// public partial class ProxyResource : - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IProxyResource, - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IProxyResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IProxyResource, + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IProxyResourceInternal, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.Resource(); + private Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Resource(); /// /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Origin(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResourceInternal)__resource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceInternal)__resource).Id; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResourceInternal)__resource).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceInternal)__resource).Id = value; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResourceInternal)__resource).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceInternal)__resource).Name = value; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResourceInternal)__resource).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceInternal)__resource).Type = value; } /// The name of the resource [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Origin(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResourceInternal)__resource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceInternal)__resource).Name; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" /// [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Origin(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResourceInternal)__resource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceInternal)__resource).Type; } /// Creates an new instance. public ProxyResource() @@ -67,13 +66,13 @@ public ProxyResource() /// The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location public partial interface IProxyResource : Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResource + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResource { } /// The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location internal partial interface IProxyResourceInternal : - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceInternal { } diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20/ProxyResource.json.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ProxyResource.json.cs similarity index 95% rename from generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20/ProxyResource.json.cs rename to generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ProxyResource.json.cs index 490715647c32..adcf2c58245c 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20/ProxyResource.json.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ProxyResource.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.ChangeAnalysis.Models.Api20 +namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class ProxyResource partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IProxyResource. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IProxyResource. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IProxyResource. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IProxyResource. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IProxyResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IProxyResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonObject json ? new ProxyResource(json) : null; } @@ -79,7 +79,7 @@ internal ProxyResource(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime { return; } - __resource = new Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.Resource(json); + __resource = new Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Resource(json); AfterFromJson(json); } diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20/Resource.PowerShell.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Resource.PowerShell.cs similarity index 73% rename from generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20/Resource.PowerShell.cs rename to generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Resource.PowerShell.cs index 66cc3533a9f3..6005ac0f4967 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20/Resource.PowerShell.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.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.ChangeAnalysis.Models.Api20 +namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models { using Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.PowerShell; @@ -57,27 +57,35 @@ public partial class Resource 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.ChangeAnalysis.Models.Api20.IResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis.Models.Api20.IResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new Resource(content); } @@ -87,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IRe /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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 Resource(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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. @@ -134,15 +142,15 @@ internal Resource(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -151,6 +159,18 @@ internal Resource(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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(); + } } /// Common fields that are returned in the response for all Azure Resource Manager resources [System.ComponentModel.TypeConverter(typeof(ResourceTypeConverter))] diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20/Resource.TypeConverter.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Resource.TypeConverter.cs similarity index 98% rename from generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20/Resource.TypeConverter.cs rename to generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Resource.TypeConverter.cs index 5d99e33765df..2ba983eca608 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20/Resource.TypeConverter.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.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.ChangeAnalysis.Models.Api20 +namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models { using Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis.Models.Api20.IResource ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResource ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResource).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResource).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20/Resource.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Resource.cs similarity index 91% rename from generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20/Resource.cs rename to generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Resource.cs index f4bf4a358e14..9fd333e3cd53 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20/Resource.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.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.ChangeAnalysis.Models.Api20 +namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Extensions; @@ -11,8 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20 /// Common fields that are returned in the response for all Azure Resource Manager resources /// public partial class Resource : - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResource, - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResource, + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis.Models.Api20.IResourceInternal.Id { get => this._id; set { {_id = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceInternal.Id { get => this._id; set { {_id = value;} } } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResourceInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceInternal.Name { get => this._name; set { {_name = value;} } } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResourceInternal.Type { get => this._type; set { {_type = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis.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.ChangeAnalysis.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.ChangeAnalysis.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/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20/Resource.json.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Resource.json.cs similarity index 94% rename from generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20/Resource.json.cs rename to generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Resource.json.cs index 572ba236ba95..c62fdbdc07a2 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20/Resource.json.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.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.ChangeAnalysis.Models.Api20 +namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class Resource partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResource. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResource. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResource. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResource. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonObject json ? new Resource(json) : null; } @@ -79,9 +79,9 @@ internal Resource(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json { 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.ChangeAnalysis.Runtime.Json.JsonNode T { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); } diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/ResourceProviderOperationDefinition.PowerShell.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ResourceProviderOperationDefinition.PowerShell.cs similarity index 61% rename from generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/ResourceProviderOperationDefinition.PowerShell.cs rename to generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ResourceProviderOperationDefinition.PowerShell.cs index f7e4e6e5223b..4c83a81d7fa2 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/ResourceProviderOperationDefinition.PowerShell.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ResourceProviderOperationDefinition.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.ChangeAnalysis.Models.Api20210401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models { using Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class ResourceProviderOperationDefinition 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.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDefinition DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDefinition DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ResourceProviderOperationDefinition(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.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDefinition DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDefinition DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ResourceProviderOperationDefinition(content); } @@ -89,10 +97,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api202104 /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDefinition FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDefinition FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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,33 +115,33 @@ internal ResourceProviderOperationDefinition(global::System.Collections.IDiction // actually deserialize if (content.Contains("Display")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDefinitionInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDefinitionInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.ResourceProviderOperationDisplayTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDefinitionInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDefinitionInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.ResourceProviderOperationDisplayTypeConverter.ConvertFrom); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDefinitionInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDefinitionInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDefinitionInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDefinitionInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("DisplayProvider")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDefinitionInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDefinitionInternal)this).DisplayProvider, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDefinitionInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDefinitionInternal)this).DisplayProvider, global::System.Convert.ToString); } if (content.Contains("DisplayResource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDefinitionInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDefinitionInternal)this).DisplayResource, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDefinitionInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDefinitionInternal)this).DisplayResource, global::System.Convert.ToString); } if (content.Contains("DisplayOperation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDefinitionInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDefinitionInternal)this).DisplayOperation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDefinitionInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDefinitionInternal)this).DisplayOperation, global::System.Convert.ToString); } if (content.Contains("DisplayDescription")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDefinitionInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDefinitionInternal)this).DisplayDescription, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDefinitionInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDefinitionInternal)this).DisplayDescription, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -148,27 +156,27 @@ internal ResourceProviderOperationDefinition(global::System.Management.Automatio // actually deserialize if (content.Contains("Display")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDefinitionInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDefinitionInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.ResourceProviderOperationDisplayTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDefinitionInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDefinitionInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.ResourceProviderOperationDisplayTypeConverter.ConvertFrom); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDefinitionInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDefinitionInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDefinitionInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDefinitionInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("DisplayProvider")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDefinitionInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDefinitionInternal)this).DisplayProvider, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDefinitionInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDefinitionInternal)this).DisplayProvider, global::System.Convert.ToString); } if (content.Contains("DisplayResource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDefinitionInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDefinitionInternal)this).DisplayResource, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDefinitionInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDefinitionInternal)this).DisplayResource, global::System.Convert.ToString); } if (content.Contains("DisplayOperation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDefinitionInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDefinitionInternal)this).DisplayOperation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDefinitionInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDefinitionInternal)this).DisplayOperation, global::System.Convert.ToString); } if (content.Contains("DisplayDescription")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDefinitionInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDefinitionInternal)this).DisplayDescription, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDefinitionInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDefinitionInternal)this).DisplayDescription, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -177,6 +185,18 @@ internal ResourceProviderOperationDefinition(global::System.Management.Automatio /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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 resource provider operation definition. [System.ComponentModel.TypeConverter(typeof(ResourceProviderOperationDefinitionTypeConverter))] diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/ResourceProviderOperationDefinition.TypeConverter.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ResourceProviderOperationDefinition.TypeConverter.cs similarity index 97% rename from generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/ResourceProviderOperationDefinition.TypeConverter.cs rename to generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ResourceProviderOperationDefinition.TypeConverter.cs index c00baeac8ccc..7422c87e3050 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/ResourceProviderOperationDefinition.TypeConverter.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ResourceProviderOperationDefinition.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.ChangeAnalysis.Models.Api20210401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models { using Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDefinition ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDefinition ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDefinition).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDefinition).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/ResourceProviderOperationDefinition.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ResourceProviderOperationDefinition.cs similarity index 74% rename from generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/ResourceProviderOperationDefinition.cs rename to generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ResourceProviderOperationDefinition.cs index 144bfec895d9..7e5c7c46b4f7 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/ResourceProviderOperationDefinition.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ResourceProviderOperationDefinition.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.ChangeAnalysis.Models.Api20210401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Extensions; /// The resource provider operation definition. public partial class ResourceProviderOperationDefinition : - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDefinition, - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDefinitionInternal + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDefinition, + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDefinitionInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDisplay _display; + private Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDisplay _display; /// The resource provider operation details. [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Origin(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDisplay Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.ResourceProviderOperationDisplay()); set => this._display = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDisplay Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.ResourceProviderOperationDisplay()); set => this._display = value; } /// Description of the resource provider operation. [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Origin(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.PropertyOrigin.Inlined)] - public string DisplayDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDisplayInternal)Display).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDisplayInternal)Display).Description = value ?? null; } + public string DisplayDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDisplayInternal)Display).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDisplayInternal)Display).Description = value ?? null; } /// Name of the resource provider operation. [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Origin(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.PropertyOrigin.Inlined)] - public string DisplayOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDisplayInternal)Display).Operation; set => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDisplayInternal)Display).Operation = value ?? null; } + public string DisplayOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDisplayInternal)Display).Operation; set => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDisplayInternal)Display).Operation = value ?? null; } /// Name of the resource provider. [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Origin(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.PropertyOrigin.Inlined)] - public string DisplayProvider { get => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDisplayInternal)Display).Provider; set => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDisplayInternal)Display).Provider = value ?? null; } + public string DisplayProvider { get => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDisplayInternal)Display).Provider; set => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDisplayInternal)Display).Provider = value ?? null; } /// Name of the resource type. [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Origin(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.PropertyOrigin.Inlined)] - public string DisplayResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDisplayInternal)Display).Resource; set => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDisplayInternal)Display).Resource = value ?? null; } + public string DisplayResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDisplayInternal)Display).Resource; set => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDisplayInternal)Display).Resource = value ?? null; } /// Internal Acessors for Display - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDisplay Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDefinitionInternal.Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.ResourceProviderOperationDisplay()); set { {_display = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDisplay Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDefinitionInternal.Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.ResourceProviderOperationDisplay()); set { {_display = value;} } } /// Backing field for property. private string _name; @@ -60,6 +60,9 @@ public partial interface IResourceProviderOperationDefinition : [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Description of the resource provider operation.", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -68,6 +71,9 @@ public partial interface IResourceProviderOperationDefinition : [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Name of the resource provider operation.", SerializedName = @"operation", PossibleTypes = new [] { typeof(string) })] @@ -76,6 +82,9 @@ public partial interface IResourceProviderOperationDefinition : [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Name of the resource provider.", SerializedName = @"provider", PossibleTypes = new [] { typeof(string) })] @@ -84,6 +93,9 @@ public partial interface IResourceProviderOperationDefinition : [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Name of the resource type.", SerializedName = @"resource", PossibleTypes = new [] { typeof(string) })] @@ -92,6 +104,9 @@ public partial interface IResourceProviderOperationDefinition : [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The resource provider operation name.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -103,7 +118,7 @@ internal partial interface IResourceProviderOperationDefinitionInternal { /// The resource provider operation details. - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDisplay Display { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDisplay Display { get; set; } /// Description of the resource provider operation. string DisplayDescription { get; set; } /// Name of the resource provider operation. diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/ResourceProviderOperationDefinition.json.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ResourceProviderOperationDefinition.json.cs similarity index 93% rename from generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/ResourceProviderOperationDefinition.json.cs rename to generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ResourceProviderOperationDefinition.json.cs index 8006af873e11..de7a6d90cfb7 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/ResourceProviderOperationDefinition.json.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ResourceProviderOperationDefinition.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.ChangeAnalysis.Models.Api20210401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ResourceProviderOperationDefinition partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDefinition. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDefinition. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDefinition. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDefinition. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDefinition FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDefinition FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonObject json ? new ResourceProviderOperationDefinition(json) : null; } @@ -77,8 +77,8 @@ internal ResourceProviderOperationDefinition(Microsoft.Azure.PowerShell.Cmdlets. { return; } - {_display = If( json?.PropertyT("display"), out var __jsonDisplay) ? Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.ResourceProviderOperationDisplay.FromJson(__jsonDisplay) : Display;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_display = If( json?.PropertyT("display"), out var __jsonDisplay) ? Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.ResourceProviderOperationDisplay.FromJson(__jsonDisplay) : _display;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} AfterFromJson(json); } diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/ResourceProviderOperationDisplay.PowerShell.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ResourceProviderOperationDisplay.PowerShell.cs similarity index 67% rename from generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/ResourceProviderOperationDisplay.PowerShell.cs rename to generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ResourceProviderOperationDisplay.PowerShell.cs index 3519cfbcbca8..3d246db91d4a 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/ResourceProviderOperationDisplay.PowerShell.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ResourceProviderOperationDisplay.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.ChangeAnalysis.Models.Api20210401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models { using Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class ResourceProviderOperationDisplay 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.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDisplay DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDisplay DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ResourceProviderOperationDisplay(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.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDisplay DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDisplay DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ResourceProviderOperationDisplay(content); } @@ -87,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api202104 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDisplay FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDisplay FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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 +113,25 @@ internal ResourceProviderOperationDisplay(global::System.Collections.IDictionary // actually deserialize if (content.Contains("Provider")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDisplayInternal)this).Provider, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDisplayInternal)this).Provider, global::System.Convert.ToString); } if (content.Contains("Resource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDisplayInternal)this).Resource, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDisplayInternal)this).Resource, global::System.Convert.ToString); } if (content.Contains("Operation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDisplayInternal)this).Operation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDisplayInternal)this).Operation, global::System.Convert.ToString); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDisplayInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDisplayInternal)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. @@ -138,19 +146,19 @@ internal ResourceProviderOperationDisplay(global::System.Management.Automation.P // actually deserialize if (content.Contains("Provider")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDisplayInternal)this).Provider, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDisplayInternal)this).Provider, global::System.Convert.ToString); } if (content.Contains("Resource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDisplayInternal)this).Resource, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDisplayInternal)this).Resource, global::System.Convert.ToString); } if (content.Contains("Operation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDisplayInternal)this).Operation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDisplayInternal)this).Operation, global::System.Convert.ToString); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDisplayInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDisplayInternal)this).Description, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -159,6 +167,18 @@ internal ResourceProviderOperationDisplay(global::System.Management.Automation.P /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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 resource provider operation details. [System.ComponentModel.TypeConverter(typeof(ResourceProviderOperationDisplayTypeConverter))] diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/ResourceProviderOperationDisplay.TypeConverter.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ResourceProviderOperationDisplay.TypeConverter.cs similarity index 97% rename from generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/ResourceProviderOperationDisplay.TypeConverter.cs rename to generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ResourceProviderOperationDisplay.TypeConverter.cs index cb2c824a6395..4cae183536ec 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/ResourceProviderOperationDisplay.TypeConverter.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ResourceProviderOperationDisplay.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.ChangeAnalysis.Models.Api20210401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models { using Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDisplay ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDisplay ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDisplay).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDisplay).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/ResourceProviderOperationDisplay.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ResourceProviderOperationDisplay.cs similarity index 93% rename from generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/ResourceProviderOperationDisplay.cs rename to generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ResourceProviderOperationDisplay.cs index c8ef593b1316..e694b836511d 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/ResourceProviderOperationDisplay.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ResourceProviderOperationDisplay.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.ChangeAnalysis.Models.Api20210401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Extensions; /// The resource provider operation details. public partial class ResourceProviderOperationDisplay : - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDisplay, - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDisplayInternal + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDisplay, + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDisplayInternal { /// Backing field for property. @@ -55,6 +55,9 @@ public partial interface IResourceProviderOperationDisplay : [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Description of the resource provider operation.", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -63,6 +66,9 @@ public partial interface IResourceProviderOperationDisplay : [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Name of the resource provider operation.", SerializedName = @"operation", PossibleTypes = new [] { typeof(string) })] @@ -71,6 +77,9 @@ public partial interface IResourceProviderOperationDisplay : [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Name of the resource provider.", SerializedName = @"provider", PossibleTypes = new [] { typeof(string) })] @@ -79,6 +88,9 @@ public partial interface IResourceProviderOperationDisplay : [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Name of the resource type.", SerializedName = @"resource", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/ResourceProviderOperationDisplay.json.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ResourceProviderOperationDisplay.json.cs similarity index 95% rename from generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/ResourceProviderOperationDisplay.json.cs rename to generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ResourceProviderOperationDisplay.json.cs index 74809fedfd69..9aa8522d9556 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/ResourceProviderOperationDisplay.json.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ResourceProviderOperationDisplay.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.ChangeAnalysis.Models.Api20210401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ResourceProviderOperationDisplay partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDisplay. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDisplay. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDisplay. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDisplay. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDisplay FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDisplay FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonObject json ? new ResourceProviderOperationDisplay(json) : null; } @@ -77,10 +77,10 @@ internal ResourceProviderOperationDisplay(Microsoft.Azure.PowerShell.Cmdlets.Cha { return; } - {_provider = If( json?.PropertyT("provider"), out var __jsonProvider) ? (string)__jsonProvider : (string)Provider;} - {_resource = If( json?.PropertyT("resource"), out var __jsonResource) ? (string)__jsonResource : (string)Resource;} - {_operation = If( json?.PropertyT("operation"), out var __jsonOperation) ? (string)__jsonOperation : (string)Operation;} - {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_provider = If( json?.PropertyT("provider"), out var __jsonProvider) ? (string)__jsonProvider : (string)_provider;} + {_resource = If( json?.PropertyT("resource"), out var __jsonResource) ? (string)__jsonResource : (string)_resource;} + {_operation = If( json?.PropertyT("operation"), out var __jsonOperation) ? (string)__jsonOperation : (string)_operation;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)_description;} AfterFromJson(json); } diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/ResourceProviderOperationList.PowerShell.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ResourceProviderOperationList.PowerShell.cs similarity index 68% rename from generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/ResourceProviderOperationList.PowerShell.cs rename to generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ResourceProviderOperationList.PowerShell.cs index a059f2141bce..5f2a3cabf134 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/ResourceProviderOperationList.PowerShell.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ResourceProviderOperationList.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.ChangeAnalysis.Models.Api20210401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models { using Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class ResourceProviderOperationList 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.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationList DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationList DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ResourceProviderOperationList(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.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ResourceProviderOperationList(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api202104 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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 +111,17 @@ internal ResourceProviderOperationList(global::System.Collections.IDictionary co // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDefinition[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.ResourceProviderOperationDefinitionTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.ResourceProviderOperationDefinitionTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationListInternal)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 +136,11 @@ internal ResourceProviderOperationList(global::System.Management.Automation.PSOb // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDefinition[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.ResourceProviderOperationDefinitionTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.ResourceProviderOperationDefinitionTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationListInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -143,6 +149,18 @@ internal ResourceProviderOperationList(global::System.Management.Automation.PSOb /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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 resource provider operation list. [System.ComponentModel.TypeConverter(typeof(ResourceProviderOperationListTypeConverter))] diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/ResourceProviderOperationList.TypeConverter.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ResourceProviderOperationList.TypeConverter.cs similarity index 97% rename from generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/ResourceProviderOperationList.TypeConverter.cs rename to generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ResourceProviderOperationList.TypeConverter.cs index 44472caa819c..0da4bc26e01e 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/ResourceProviderOperationList.TypeConverter.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ResourceProviderOperationList.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.ChangeAnalysis.Models.Api20210401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models { using Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationList ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationList ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationList).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationList).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/ResourceProviderOperationList.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ResourceProviderOperationList.cs similarity index 76% rename from generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/ResourceProviderOperationList.cs rename to generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ResourceProviderOperationList.cs index 6775e875537e..4219ab0df468 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/ResourceProviderOperationList.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ResourceProviderOperationList.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.ChangeAnalysis.Models.Api20210401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Extensions; /// The resource provider operation list. public partial class ResourceProviderOperationList : - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationList, - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationListInternal + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationList, + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationListInternal { /// Backing field for property. @@ -21,11 +21,11 @@ public partial class ResourceProviderOperationList : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDefinition[] _value; + private System.Collections.Generic.List _value; /// Resource provider operations list. [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Origin(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDefinition[] 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 ResourceProviderOperationList() @@ -41,6 +41,9 @@ public partial interface IResourceProviderOperationList : [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The URI that can be used to request the next page for list of Azure operations.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -49,10 +52,13 @@ public partial interface IResourceProviderOperationList : [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Resource provider operations list.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDefinition) })] - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDefinition[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDefinition) })] + System.Collections.Generic.List Value { get; set; } } /// The resource provider operation list. @@ -62,7 +68,7 @@ internal partial interface IResourceProviderOperationListInternal /// The URI that can be used to request the next page for list of Azure operations. string NextLink { get; set; } /// Resource provider operations list. - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDefinition[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/ResourceProviderOperationList.json.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ResourceProviderOperationList.json.cs similarity index 90% rename from generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/ResourceProviderOperationList.json.cs rename to generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ResourceProviderOperationList.json.cs index 12a034941d74..8ae304455355 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/Api20210401/ResourceProviderOperationList.json.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Models/ResourceProviderOperationList.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.ChangeAnalysis.Models.Api20210401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ResourceProviderOperationList partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationList. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationList. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationList. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationList. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationList FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationList FromJson(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Json.JsonObject json ? new ResourceProviderOperationList(json) : null; } @@ -77,8 +77,8 @@ internal ResourceProviderOperationList(Microsoft.Azure.PowerShell.Cmdlets.Change { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDefinition) (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.ResourceProviderOperationDefinition.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.ChangeAnalysis.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.ChangeAnalysis.Models.IResourceProviderOperationDefinition) (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.ResourceProviderOperationDefinition.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Support/ChangeCategory.Completer.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Support/ChangeCategory.Completer.cs deleted file mode 100644 index c4bf6065ef9a..000000000000 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Support/ChangeCategory.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.ChangeAnalysis.Support -{ - - /// The change category. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support.ChangeCategoryTypeConverter))] - public partial struct ChangeCategory : - System.Management.Automation.IArgumentCompleter - { - - /// - /// Implementations of this function are called by PowerShell to complete arguments. - /// - /// The name of the command that needs argument completion. - /// The name of the parameter that needs argument completion. - /// The (possibly empty) word being completed. - /// The command ast in case it is needed for completion. - /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot - /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. - /// - /// A collection of completion results, most like with ResultType set to ParameterValue. - /// - public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) - { - if (global::System.String.IsNullOrEmpty(wordToComplete) || "User".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'User'", "User", global::System.Management.Automation.CompletionResultType.ParameterValue, "User"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "System".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'System'", "System", global::System.Management.Automation.CompletionResultType.ParameterValue, "System"); - } - } - } -} \ No newline at end of file diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Support/ChangeCategory.TypeConverter.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Support/ChangeCategory.TypeConverter.cs deleted file mode 100644 index dc46155cb1b7..000000000000 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Support/ChangeCategory.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.ChangeAnalysis.Support -{ - - /// The change category. - public partial class ChangeCategoryTypeConverter : - 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) => ChangeCategory.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/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Support/ChangeCategory.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Support/ChangeCategory.cs deleted file mode 100644 index f38cc2cc37b9..000000000000 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Support/ChangeCategory.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.ChangeAnalysis.Support -{ - - /// The change category. - public partial struct ChangeCategory : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support.ChangeCategory System = @"System"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support.ChangeCategory User = @"User"; - - /// 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 ChangeCategory(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to ChangeCategory - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ChangeCategory(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ChangeCategory - /// 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.ChangeAnalysis.Support.ChangeCategory e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type ChangeCategory (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 ChangeCategory && Equals((ChangeCategory)obj); - } - - /// Returns hashCode for enum ChangeCategory - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for ChangeCategory - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to ChangeCategory - /// the value to convert to an instance of . - - public static implicit operator ChangeCategory(string value) - { - return new ChangeCategory(value); - } - - /// Implicit operator to convert ChangeCategory to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support.ChangeCategory e) - { - return e._value; - } - - /// Overriding != operator for enum ChangeCategory - /// 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.ChangeAnalysis.Support.ChangeCategory e1, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support.ChangeCategory e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ChangeCategory - /// 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.ChangeAnalysis.Support.ChangeCategory e1, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support.ChangeCategory e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Support/ChangeType.Completer.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Support/ChangeType.Completer.cs deleted file mode 100644 index 9ce796c176cc..000000000000 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Support/ChangeType.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.ChangeAnalysis.Support -{ - - /// The type of the change. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support.ChangeTypeTypeConverter))] - public partial struct ChangeType : - 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) || "Add".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Add'", "Add", global::System.Management.Automation.CompletionResultType.ParameterValue, "Add"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Remove".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Remove'", "Remove", global::System.Management.Automation.CompletionResultType.ParameterValue, "Remove"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Update".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Update'", "Update", global::System.Management.Automation.CompletionResultType.ParameterValue, "Update"); - } - } - } -} \ No newline at end of file diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Support/ChangeType.TypeConverter.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Support/ChangeType.TypeConverter.cs deleted file mode 100644 index fe12e5292ae0..000000000000 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Support/ChangeType.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.ChangeAnalysis.Support -{ - - /// The type of the change. - public partial class ChangeTypeTypeConverter : - 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) => ChangeType.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/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Support/ChangeType.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Support/ChangeType.cs deleted file mode 100644 index f4de9caf0f10..000000000000 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Support/ChangeType.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.ChangeAnalysis.Support -{ - - /// The type of the change. - public partial struct ChangeType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support.ChangeType Add = @"Add"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support.ChangeType Remove = @"Remove"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support.ChangeType Update = @"Update"; - - /// 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 ChangeType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to ChangeType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ChangeType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ChangeType - /// 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.ChangeAnalysis.Support.ChangeType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type ChangeType (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 ChangeType && Equals((ChangeType)obj); - } - - /// Returns hashCode for enum ChangeType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for ChangeType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to ChangeType - /// the value to convert to an instance of . - - public static implicit operator ChangeType(string value) - { - return new ChangeType(value); - } - - /// Implicit operator to convert ChangeType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support.ChangeType e) - { - return e._value; - } - - /// Overriding != operator for enum ChangeType - /// 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.ChangeAnalysis.Support.ChangeType e1, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support.ChangeType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ChangeType - /// 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.ChangeAnalysis.Support.ChangeType e1, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support.ChangeType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Support/Level.Completer.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Support/Level.Completer.cs deleted file mode 100644 index bf420b26c609..000000000000 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Support/Level.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.ChangeAnalysis.Support -{ - - /// Argument completer implementation for Level. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support.LevelTypeConverter))] - public partial struct Level : - 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) || "Noisy".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Noisy'", "Noisy", global::System.Management.Automation.CompletionResultType.ParameterValue, "Noisy"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Normal".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Normal'", "Normal", global::System.Management.Automation.CompletionResultType.ParameterValue, "Normal"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Important".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Important'", "Important", global::System.Management.Automation.CompletionResultType.ParameterValue, "Important"); - } - } - } -} \ No newline at end of file diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Support/Level.TypeConverter.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Support/Level.TypeConverter.cs deleted file mode 100644 index a18d13e87912..000000000000 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Support/Level.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.ChangeAnalysis.Support -{ - - /// TypeConverter implementation for Level. - public partial class LevelTypeConverter : - 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) => Level.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/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Support/Level.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Support/Level.cs deleted file mode 100644 index 0ea876917fac..000000000000 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/api/Support/Level.cs +++ /dev/null @@ -1,99 +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.ChangeAnalysis.Support -{ - - public partial struct Level : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support.Level Important = @"Important"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support.Level Noisy = @"Noisy"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support.Level Normal = @"Normal"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to Level - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new Level(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type Level - /// 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.ChangeAnalysis.Support.Level e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type Level (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 Level && Equals((Level)obj); - } - - /// Returns hashCode for enum Level - /// 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 Level(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for Level - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to Level - /// the value to convert to an instance of . - - public static implicit operator Level(string value) - { - return new Level(value); - } - - /// Implicit operator to convert Level to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support.Level e) - { - return e._value; - } - - /// Overriding != operator for enum Level - /// 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.ChangeAnalysis.Support.Level e1, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support.Level e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum Level - /// 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.ChangeAnalysis.Support.Level e1, Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support.Level e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/cmdlets/GetAzChangeAnalysisOperation_List.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/cmdlets/GetAzChangeAnalysisOperation_List.cs index 520870e6ca4c..f2b127acf77a 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/cmdlets/GetAzChangeAnalysisOperation_List.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/cmdlets/GetAzChangeAnalysisOperation_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Cmdlets; using System; /// @@ -16,12 +18,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzChangeAnalysisOperation_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDefinition))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDefinition))] [global::Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Description(@"Lists all the supported operations by the Microsoft.ChangeAnalysis resource provider along with their descriptions.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.HttpPath(Path = "/providers/Microsoft.ChangeAnalysis/operations", ApiVersion = "2021-04-01")] public partial class GetAzChangeAnalysisOperation_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -37,17 +40,32 @@ public partial class GetAzChangeAnalysisOperation_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.ChangeAnalysis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis.ChangeAnalysis Client => Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Module.Instance.ClientAPI; @@ -61,6 +79,9 @@ public partial class GetAzChangeAnalysisOperation_List : global::System.Manageme [global::Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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 GetAzChangeAnalysisOperation_List : global::System.Manageme /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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,24 +149,24 @@ public partial class GetAzChangeAnalysisOperation_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.ChangeAnalysis.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationList /// 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) @@ -168,6 +189,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.ChangeAnalysis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -189,7 +215,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzChangeAnalysisOperation_List() { @@ -240,8 +266,33 @@ public GetAzChangeAnalysisOperation_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.ChangeAnalysis.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.ChangeAnalysis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -294,7 +345,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -312,7 +363,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SkipToken=this.InvocationInformation.BoundParameters.ContainsKey("SkipToken") ? SkipToken : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SkipToken=this.InvocationInformation.BoundParameters.ContainsKey("SkipToken") ? SkipToken : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -350,12 +401,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.ChangeAnalysis.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -372,15 +423,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.ChangeAnalysis.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SkipToken=this.InvocationInformation.BoundParameters.ContainsKey("SkipToken") ? SkipToken : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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 { SkipToken=this.InvocationInformation.BoundParameters.ContainsKey("SkipToken") ? SkipToken : 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 } }); @@ -390,12 +441,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.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationList /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -407,15 +458,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationList + 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/ChangeAnalysis/ChangeAnalysis.Autorest/generated/cmdlets/GetAzChangeAnalysis_List.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/cmdlets/GetAzChangeAnalysis_List.cs index 2a6855456ba0..e303a453e295 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/cmdlets/GetAzChangeAnalysis_List.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/cmdlets/GetAzChangeAnalysis_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Cmdlets; using System; /// @@ -16,12 +18,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Cmdlets /// [OpenAPI] ListByResourceId=>POST:"/{resourceId}/providers/Microsoft.ChangeAnalysis/resourceChanges" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzChangeAnalysis_List", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChange))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChange))] [global::Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Description(@"Customer data is always masked if query at subscription or resource group level. For query on a single resource, customer data is masked if the user doesn’t have access.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.HttpPath(Path = "/{resourceId}/providers/Microsoft.ChangeAnalysis/resourceChanges", ApiVersion = "2021-04-01")] public partial class GetAzChangeAnalysis_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -37,17 +40,32 @@ public partial class GetAzChangeAnalysis_List : global::System.Management.Automa /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis.ChangeAnalysis Client => Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Module.Instance.ClientAPI; @@ -75,6 +93,9 @@ public partial class GetAzChangeAnalysis_List : global::System.Management.Automa [global::Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.ParameterCategory.Query)] public global::System.DateTime EndTime { get => this._endTime; set => this._endTime = 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] @@ -101,7 +122,7 @@ public partial class GetAzChangeAnalysis_List : global::System.Management.Automa /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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")] @@ -170,24 +191,24 @@ public partial class GetAzChangeAnalysis_List : global::System.Management.Automa /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis.Models.Api20210401.IChangeList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeList /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -210,6 +231,11 @@ 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.ChangeAnalysis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -231,7 +257,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzChangeAnalysis_List() { @@ -282,8 +308,33 @@ public GetAzChangeAnalysis_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.ChangeAnalysis.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.ChangeAnalysis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -339,7 +390,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -357,7 +408,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceId=ResourceId,StartTime=StartTime,EndTime=EndTime,SkipToken=this.InvocationInformation.BoundParameters.ContainsKey("SkipToken") ? SkipToken : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceId=ResourceId,StartTime=StartTime,EndTime=EndTime,SkipToken=this.InvocationInformation.BoundParameters.ContainsKey("SkipToken") ? SkipToken : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -395,12 +446,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.ChangeAnalysis.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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 ) { @@ -417,15 +468,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.ChangeAnalysis.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceId=ResourceId, StartTime=StartTime, EndTime=EndTime, SkipToken=this.InvocationInformation.BoundParameters.ContainsKey("SkipToken") ? SkipToken : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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, StartTime=StartTime, EndTime=EndTime, SkipToken=this.InvocationInformation.BoundParameters.ContainsKey("SkipToken") ? SkipToken : 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 } }); @@ -435,12 +486,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.ChangeAnalysis.Models.Api20210401.IChangeList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeList /// 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 ) { @@ -452,15 +503,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeList + 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/ChangeAnalysis/ChangeAnalysis.Autorest/generated/cmdlets/GetAzChangeAnalysis_List1.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/cmdlets/GetAzChangeAnalysis_List1.cs index bafe3b968d70..6592cb278a0e 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/cmdlets/GetAzChangeAnalysis_List1.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/cmdlets/GetAzChangeAnalysis_List1.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Cmdlets; using System; /// @@ -15,12 +17,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Cmdlets /// [OpenAPI] ListByResourceGroup=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ChangeAnalysis/changes" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzChangeAnalysis_List1")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChange))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChange))] [global::Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Description(@"List the changes of a resource group within the specified time range. Customer data will always be masked.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ChangeAnalysis/changes", ApiVersion = "2021-04-01")] public partial class GetAzChangeAnalysis_List1 : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -36,17 +39,32 @@ public partial class GetAzChangeAnalysis_List1 : global::System.Management.Autom /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis.ChangeAnalysis Client => Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Module.Instance.ClientAPI; @@ -74,6 +92,9 @@ public partial class GetAzChangeAnalysis_List1 : global::System.Management.Autom [global::Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.ParameterCategory.Query)] public global::System.DateTime EndTime { get => this._endTime; set => this._endTime = 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] @@ -100,7 +121,7 @@ public partial class GetAzChangeAnalysis_List1 : global::System.Management.Autom /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -178,7 +199,8 @@ public partial class GetAzChangeAnalysis_List1 : global::System.Management.Autom [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -187,24 +209,24 @@ public partial class GetAzChangeAnalysis_List1 : global::System.Management.Autom /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis.Models.Api20210401.IChangeList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeList /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -227,6 +249,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -248,7 +275,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzChangeAnalysis_List1() { @@ -299,8 +326,33 @@ public GetAzChangeAnalysis_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.ChangeAnalysis.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.ChangeAnalysis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -353,7 +405,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -374,7 +426,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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,StartTime=StartTime,EndTime=EndTime,SkipToken=this.InvocationInformation.BoundParameters.ContainsKey("SkipToken") ? SkipToken : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,StartTime=StartTime,EndTime=EndTime,SkipToken=this.InvocationInformation.BoundParameters.ContainsKey("SkipToken") ? SkipToken : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -412,12 +464,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.ChangeAnalysis.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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 ) { @@ -434,15 +486,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.ChangeAnalysis.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, StartTime=StartTime, EndTime=EndTime, SkipToken=this.InvocationInformation.BoundParameters.ContainsKey("SkipToken") ? SkipToken : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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, StartTime=StartTime, EndTime=EndTime, SkipToken=this.InvocationInformation.BoundParameters.ContainsKey("SkipToken") ? SkipToken : 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 } }); @@ -452,12 +504,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.ChangeAnalysis.Models.Api20210401.IChangeList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeList /// 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 ) { @@ -469,15 +521,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeList + 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/ChangeAnalysis/ChangeAnalysis.Autorest/generated/cmdlets/GetAzChangeAnalysis_List2.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/cmdlets/GetAzChangeAnalysis_List2.cs index f94c6ff7ec03..7bb9a60eafb4 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/cmdlets/GetAzChangeAnalysis_List2.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/cmdlets/GetAzChangeAnalysis_List2.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Cmdlets; using System; /// @@ -15,12 +17,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Cmdlets /// [OpenAPI] ListBySubscription=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.ChangeAnalysis/changes" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzChangeAnalysis_List2")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IChange))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChange))] [global::Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Description(@"List the changes of a subscription within the specified time range. Customer data will always be masked.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.ChangeAnalysis/changes", ApiVersion = "2021-04-01")] public partial class GetAzChangeAnalysis_List2 : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -36,17 +39,32 @@ public partial class GetAzChangeAnalysis_List2 : global::System.Management.Autom /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis.ChangeAnalysis Client => Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Module.Instance.ClientAPI; @@ -74,6 +92,9 @@ public partial class GetAzChangeAnalysis_List2 : global::System.Management.Autom [global::Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.ParameterCategory.Query)] public global::System.DateTime EndTime { get => this._endTime; set => this._endTime = 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] @@ -100,7 +121,7 @@ public partial class GetAzChangeAnalysis_List2 : global::System.Management.Autom /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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")] @@ -164,7 +185,8 @@ public partial class GetAzChangeAnalysis_List2 : global::System.Management.Autom [Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -173,24 +195,24 @@ public partial class GetAzChangeAnalysis_List2 : 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.ChangeAnalysis.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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.ChangeAnalysis.Models.Api20210401.IChangeList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeList /// 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) @@ -213,6 +235,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.ChangeAnalysis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -234,7 +261,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzChangeAnalysis_List2() { @@ -285,8 +312,33 @@ public GetAzChangeAnalysis_List2() 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.ChangeAnalysis.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.ChangeAnalysis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -339,7 +391,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -360,7 +412,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,StartTime=StartTime,EndTime=EndTime,SkipToken=this.InvocationInformation.BoundParameters.ContainsKey("SkipToken") ? SkipToken : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,StartTime=StartTime,EndTime=EndTime,SkipToken=this.InvocationInformation.BoundParameters.ContainsKey("SkipToken") ? SkipToken : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -398,12 +450,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.ChangeAnalysis.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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 ) { @@ -420,15 +472,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.ChangeAnalysis.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, StartTime=StartTime, EndTime=EndTime, SkipToken=this.InvocationInformation.BoundParameters.ContainsKey("SkipToken") ? SkipToken : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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, StartTime=StartTime, EndTime=EndTime, SkipToken=this.InvocationInformation.BoundParameters.ContainsKey("SkipToken") ? SkipToken : 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 } }); @@ -438,12 +490,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.ChangeAnalysis.Models.Api20210401.IChangeList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeList /// 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 ) { @@ -455,15 +507,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IChangeList + 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/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/Attributes/ExternalDocsAttribute.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/Attributes/ExternalDocsAttribute.cs new file mode 100644 index 000000000000..d52b60b30912 --- /dev/null +++ b/generated/ChangeAnalysis/ChangeAnalysis.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.ChangeAnalysis +{ + 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/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/Attributes/PSArgumentCompleterAttribute.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/Attributes/PSArgumentCompleterAttribute.cs new file mode 100644 index 000000000000..8a24d75ade68 --- /dev/null +++ b/generated/ChangeAnalysis/ChangeAnalysis.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.ChangeAnalysis +{ + 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/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs index cd642673c329..37d46cc19e76 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.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.ChangeAnalysis.Models"; - private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs index cec7f99e981f..bdb4d8a42c73 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.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.ChangeAnalysis.Models"; - private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Support"; + private const string SupportNamespace = @"${$project.supportNamespace.fullName}"; protected override void ProcessRecord() { diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs index 4af9d81fc033..2f9a06895b50 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.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/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs index 95a8ae779587..cfb88fc9edb6 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.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/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs index 07f5d5cc63d0..895e4765ffb6 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs @@ -12,50 +12,96 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs index e21a739521ad..8dfa17ff91a6 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.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/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs index 664fee9a1f96..97787945c79a 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.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/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs index 4256d3474a9c..403ad0d73bb6 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.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.ChangeAnalysis.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.ChangeAnalysis.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.ChangeAnalysis.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/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs index e1a04998ff9d..a3bdc95b7ec6 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs @@ -31,7 +31,7 @@ internal class VariantGroup { public string ModuleName { get; } - public string RootModuleName {get => @"";} + public string RootModuleName { get => @""; } public string CmdletName { get; } public string CmdletVerb { get; } public string CmdletNoun { get; } @@ -49,7 +49,7 @@ internal class VariantGroup public PsHelpInfo HelpInfo { get; } public bool IsGenerated { get; } public bool IsInternal { get; } - + public bool IsModelCmdlet { get; } public string OutputFolder { get; } public string FileName { get; } public string FilePath { get; } @@ -84,7 +84,7 @@ public VariantGroup(string moduleName, string cmdletName, Variant[] variants, st HelpInfo = Variants.Select(v => v.HelpInfo).FirstOrDefault() ?? new PsHelpInfo(); IsGenerated = Variants.All(v => v.Attributes.OfType().Any()); IsInternal = isInternal; - + IsModelCmdlet = Variants.All(v => v.IsModelCmdlet); OutputFolder = outputFolder; FileName = $"{CmdletName}{(isTest ? ".Tests" : String.Empty)}.ps1"; FilePath = Path.Combine(OutputFolder, FileName); @@ -101,12 +101,23 @@ private string DetermineDefaultParameterSetName() if (String.IsNullOrEmpty(defaultParameterSet)) { var variantParamCountGroups = Variants + .Where(v => !v.IsNotSuggestDefaultParameterSet) .Select(v => ( variant: v.VariantName, paramCount: v.CmdletOnlyParameters.Count(p => p.IsMandatory), isSimple: v.CmdletOnlyParameters.Where(p => p.IsMandatory).All(p => p.ParameterType.IsPsSimple()))) .GroupBy(vpc => vpc.isSimple) .ToArray(); + if (variantParamCountGroups.Length == 0) + { + variantParamCountGroups = Variants + .Select(v => ( + variant: v.VariantName, + paramCount: v.CmdletOnlyParameters.Count(p => p.IsMandatory), + isSimple: v.CmdletOnlyParameters.Where(p => p.IsMandatory).All(p => p.ParameterType.IsPsSimple()))) + .GroupBy(vpc => vpc.isSimple) + .ToArray(); + } var variantParameterCounts = (variantParamCountGroups.Any(g => g.Key) ? variantParamCountGroups.Where(g => g.Key) : variantParamCountGroups).SelectMany(g => g).ToArray(); var smallestParameterCount = variantParameterCounts.Min(vpc => vpc.paramCount); defaultParameterSet = variantParameterCounts.First(vpc => vpc.paramCount == smallestParameterCount).variant; @@ -134,7 +145,9 @@ internal class Variant public Parameter[] Parameters { get; } public Parameter[] CmdletOnlyParameters { get; } public bool IsInternal { get; } + public bool IsModelCmdlet { get; } public bool IsDoNotExport { get; } + public bool IsNotSuggestDefaultParameterSet { get; } public string[] Profiles { get; } public Variant(string cmdletName, string variantName, CommandInfo info, CommandMetadata metadata, bool hasParameterSets = false, PsHelpInfo helpInfo = null) @@ -155,6 +168,8 @@ public Variant(string cmdletName, string variantName, CommandInfo info, CommandM Parameters = this.ToParameters().OrderBy(p => p.OrderCategory).ThenByDescending(p => p.IsMandatory).ToArray(); IsInternal = Attributes.OfType().Any(); IsDoNotExport = Attributes.OfType().Any(); + IsModelCmdlet = Attributes.OfType().Any(); + IsNotSuggestDefaultParameterSet = Attributes.OfType().Any(); CmdletOnlyParameters = Parameters.Where(p => !p.Categories.Any(c => c == ParameterCategory.Azure || c == ParameterCategory.Runtime)).ToArray(); Profiles = Attributes.OfType().SelectMany(pa => pa.Profiles).ToArray(); } @@ -210,6 +225,7 @@ public ParameterGroup(string parameterName, Parameter[] parameters, string[] all HasValidateNotNull = Parameters.SelectMany(p => p.Attributes.OfType()).Any(); HasAllowEmptyArray = Parameters.SelectMany(p => p.Attributes.OfType()).Any(); CompleterInfo = Parameters.Select(p => p.CompleterInfoAttribute).FirstOrDefault()?.ToCompleterInfo() + ?? Parameters.Select(p => p.PSArgumentCompleterAttribute).FirstOrDefault()?.ToPSArgumentCompleterInfo() ?? Parameters.Select(p => p.ArgumentCompleterAttribute).FirstOrDefault()?.ToCompleterInfo(); DefaultInfo = Parameters.Select(p => p.DefaultInfoAttribute).FirstOrDefault()?.ToDefaultInfo(this) ?? Parameters.Select(p => p.DefaultValueAttribute).FirstOrDefault(dv => dv != null)?.ToDefaultInfo(this); @@ -244,7 +260,6 @@ internal class Parameter public ParameterMetadata Metadata { get; } public PsParameterHelpInfo HelpInfo { get; } public Type ParameterType { get; } - public Attribute[] Attributes { get; } public ParameterCategory[] Categories { get; } public ParameterCategory OrderCategory { get; } @@ -254,6 +269,7 @@ internal class Parameter public bool SupportsWildcards { get; } public CompleterInfoAttribute CompleterInfoAttribute { get; } public ArgumentCompleterAttribute ArgumentCompleterAttribute { get; } + public PSArgumentCompleterAttribute PSArgumentCompleterAttribute { get; } public bool ValueFromPipeline { get; } public bool ValueFromPipelineByPropertyName { get; } @@ -286,7 +302,8 @@ public Parameter(string variantName, string parameterName, ParameterMetadata met } SupportsWildcards = Attributes.OfType().Any(); CompleterInfoAttribute = Attributes.OfType().FirstOrDefault(); - ArgumentCompleterAttribute = Attributes.OfType().FirstOrDefault(); + PSArgumentCompleterAttribute = Attributes.OfType().FirstOrDefault(); + ArgumentCompleterAttribute = Attributes.OfType().FirstOrDefault(attr => !attr.GetType().Equals(typeof(PSArgumentCompleterAttribute))); ValueFromPipeline = ParameterAttribute.ValueFromPipeline; ValueFromPipelineByPropertyName = ParameterAttribute.ValueFromPipelineByPropertyName; @@ -295,10 +312,10 @@ public Parameter(string variantName, string parameterName, ParameterMetadata met IsMandatory = ParameterAttribute.Mandatory; var complexParameterName = ParameterName.ToUpperInvariant(); - var complexMessage = $"{Environment.NewLine}To construct, see NOTES section for {complexParameterName} properties and create a hash table."; + var complexMessage = $"{Environment.NewLine}"; var description = ParameterAttribute.HelpMessage.NullIfEmpty() ?? HelpInfo.Description.NullIfEmpty() ?? InfoAttribute?.Description.NullIfEmpty() ?? String.Empty; // Remove the complex type message as it will be reinserted if this is a complex type - description = description.NormalizeNewLines().Replace(complexMessage, String.Empty).Replace(complexMessage.ToPsSingleLine(), String.Empty); + description = description.NormalizeNewLines(); // Make an InfoAttribute for processing only if one isn't provided InfoAttribute = Attributes.OfType().FirstOrDefault() ?? new InfoAttribute { PossibleTypes = new[] { ParameterType.Unwrap() }, Required = IsMandatory }; // Set the description if the InfoAttribute does not have one since they are exported without a description @@ -318,7 +335,7 @@ internal class ComplexInterfaceInfo public bool Required { get; } public bool ReadOnly { get; } public string Description { get; } - + public ComplexInterfaceInfo[] NestedInfos { get; } public bool IsComplexInterface { get; } @@ -335,7 +352,7 @@ public ComplexInterfaceInfo(string name, Type type, InfoAttribute infoAttribute, var unwrappedType = Type.Unwrap(); var hasBeenSeen = seenTypes?.Contains(unwrappedType) ?? false; (seenTypes ?? (seenTypes = new List())).Add(unwrappedType); - NestedInfos = hasBeenSeen ? new ComplexInterfaceInfo[]{} : + NestedInfos = hasBeenSeen ? new ComplexInterfaceInfo[] { } : unwrappedType.GetInterfaces() .Concat(InfoAttribute.PossibleTypes) .SelectMany(pt => pt.GetProperties() @@ -366,6 +383,7 @@ internal class CommentInfo public string OnlineVersion { get; } public string[] RelatedLinks { get; } + public string[] ExternalUrls { get; } private const string HelpLinkPrefix = @"https://learn.microsoft.com/powershell/module/"; @@ -391,6 +409,9 @@ public CommentInfo(VariantGroup variantGroup) var moduleName = variantGroup.RootModuleName == "" ? variantGroup.ModuleName.ToLowerInvariant() : variantGroup.RootModuleName.ToLowerInvariant(); OnlineVersion = helpInfo.OnlineVersion?.Uri.NullIfEmpty() ?? $@"{HelpLinkPrefix}{moduleName}/{variantGroup.CmdletName.ToLowerInvariant()}"; RelatedLinks = helpInfo.RelatedLinks.Select(rl => rl.Text).ToArray(); + + // Get external urls from attribute + ExternalUrls = variantGroup.Variants.SelectMany(v => v.Attributes).OfType()?.Select(e => e.Url)?.Distinct()?.ToArray(); } } @@ -420,11 +441,22 @@ public CompleterInfo(ArgumentCompleterAttribute completerAttribute) } } + internal class PSArgumentCompleterInfo : CompleterInfo + { + public string[] ResourceTypes { get; } + + public PSArgumentCompleterInfo(PSArgumentCompleterAttribute completerAttribute) : base(completerAttribute) + { + ResourceTypes = completerAttribute.ResourceTypes; + } + } + internal class DefaultInfo { public string Name { get; } public string Description { get; } public string Script { get; } + public string SetCondition { get; } public ParameterGroup ParameterGroup { get; } public DefaultInfo(DefaultInfoAttribute infoAttribute, ParameterGroup parameterGroup) @@ -432,6 +464,7 @@ public DefaultInfo(DefaultInfoAttribute infoAttribute, ParameterGroup parameterG Name = infoAttribute.Name; Description = infoAttribute.Description; Script = infoAttribute.Script; + SetCondition = infoAttribute.SetCondition; ParameterGroup = parameterGroup; } @@ -479,7 +512,8 @@ public static Parameter[] ToParameters(this Variant variant) parameterHelp = parameterHelp.Where(ph => (!ph.ParameterSetNames.Any() || ph.ParameterSetNames.Any(psn => psn == variant.VariantName || psn == AllParameterSets)) && ph.Name != "IncludeTotalCount"); } var result = parameters.Select(p => new Parameter(variant.VariantName, p.Key, p.Value, parameterHelp.FirstOrDefault(ph => ph.Name == p.Key))); - if (variant.SupportsPaging) { + if (variant.SupportsPaging) + { // If supportsPaging is set, we will need to add First and Skip parameters since they are treated as common parameters which as not contained on Metadata>parameters variant.Info.Parameters["First"].Attributes.OfType().FirstOrDefault(pa => pa.ParameterSetName == variant.VariantName || pa.ParameterSetName == AllParameterSets).HelpMessage = "Gets only the first 'n' objects."; variant.Info.Parameters["Skip"].Attributes.OfType().FirstOrDefault(pa => pa.ParameterSetName == variant.VariantName || pa.ParameterSetName == AllParameterSets).HelpMessage = "Ignores the first 'n' objects and then gets the remaining objects."; @@ -507,7 +541,7 @@ public static ComplexInterfaceInfo ToComplexInterfaceInfo(this InfoAttribute inf public static CompleterInfo ToCompleterInfo(this CompleterInfoAttribute infoAttribute) => new CompleterInfo(infoAttribute); public static CompleterInfo ToCompleterInfo(this ArgumentCompleterAttribute completerAttribute) => new CompleterInfo(completerAttribute); - + public static PSArgumentCompleterInfo ToPSArgumentCompleterInfo(this PSArgumentCompleterAttribute completerAttribute) => new PSArgumentCompleterInfo(completerAttribute); public static DefaultInfo ToDefaultInfo(this DefaultInfoAttribute infoAttribute, ParameterGroup parameterGroup) => new DefaultInfo(infoAttribute, parameterGroup); public static DefaultInfo ToDefaultInfo(this PSDefaultValueAttribute defaultValueAttribute, ParameterGroup parameterGroup) => new DefaultInfo(defaultValueAttribute, parameterGroup); } diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/BuildTime/PsAttributes.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/BuildTime/PsAttributes.cs index e0ad0b88a7fd..8518831c9265 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/BuildTime/PsAttributes.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.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/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/BuildTime/PsExtensions.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/BuildTime/PsExtensions.cs index 4e7f2ec131ca..b2600070e79e 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/BuildTime/PsExtensions.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/BuildTime/PsExtensions.cs @@ -13,6 +13,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.PowerShell { internal static class PsExtensions { + public static PSObject AddMultipleTypeNameIntoPSObject(this object obj, string multipleTag = "#Multiple") + { + var psObj = new PSObject(obj); + psObj.TypeNames.Insert(0, $"{psObj.TypeNames[0]}{multipleTag}"); + return psObj; + } + // https://stackoverflow.com/a/863944/294804 // https://stackoverflow.com/a/4452598/294804 // https://stackoverflow.com/a/28701974/294804 diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/BuildTime/PsHelpers.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/BuildTime/PsHelpers.cs index cc6ecc4bc314..85685209a8c2 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/BuildTime/PsHelpers.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.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/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/Context.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/Context.cs new file mode 100644 index 000000000000..deb6b3408cfd --- /dev/null +++ b/generated/ChangeAnalysis/ChangeAnalysis.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.ChangeAnalysis.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.ChangeAnalysis.Runtime.Extensions; + + /// + /// The IContext Interface defines the communication mechanism for input customization. + /// + /// + /// In the context, we will have client, pipeline, PSBoundParamters, default EventListener, Cancellation. + /// + public interface IContext + { + System.Management.Automation.InvocationInfo InvocationInformation { get; set; } + System.Threading.CancellationTokenSource CancellationTokenSource { get; set; } + System.Collections.Generic.IDictionary ExtensibleParameters { get; } + HttpPipeline Pipeline { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.ChangeAnalysis Client { get; } + } +} diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/Events.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/Events.cs index d8f6876bca15..1d87ccff75e7 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/Events.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.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/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/ISendAsync.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/ISendAsync.cs index ade13ef3d68f..aca8f6e49bee 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/ISendAsync.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/ISendAsync.cs @@ -11,6 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.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/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/InfoAttribute.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/InfoAttribute.cs index 6596e4ea07c5..b2a8e6a87ba4 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/InfoAttribute.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.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/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/InputHandler.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/InputHandler.cs new file mode 100644 index 000000000000..8b8d380e1389 --- /dev/null +++ b/generated/ChangeAnalysis/ChangeAnalysis.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.ChangeAnalysis.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.ChangeAnalysis.Runtime.IContext context); + } +} \ No newline at end of file diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs index bf65dac69c44..091300a796bc 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.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/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/SerializationMode.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/SerializationMode.cs index ecc93e8bfe85..e2f3d0266e8e 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/SerializationMode.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.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/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/TypeConverterExtensions.cs b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/TypeConverterExtensions.cs index 033617279a3f..db94ad23acc4 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/generated/runtime/TypeConverterExtensions.cs +++ b/generated/ChangeAnalysis/ChangeAnalysis.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/ChangeAnalysis/ChangeAnalysis.Autorest/internal/Get-AzChangeAnalysisOperation.ps1 b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/internal/Get-AzChangeAnalysisOperation.ps1 index be9f23a5774c..c8aa69b4e252 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/internal/Get-AzChangeAnalysisOperation.ps1 +++ b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/internal/Get-AzChangeAnalysisOperation.ps1 @@ -25,12 +25,12 @@ Lists all the supported operations by the Microsoft.ChangeAnalysis resource prov {{ Add code here }} .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDefinition +Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDefinition .Link https://learn.microsoft.com/powershell/module/az.changeanalysis/get-azchangeanalysisoperation #> function Get-AzChangeAnalysisOperation { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDefinition])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDefinition])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter()] @@ -96,12 +96,18 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ List = 'Az.ChangeAnalysis.private\Get-AzChangeAnalysisOperation_List'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/internal/ProxyCmdletDefinitions.ps1 b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/internal/ProxyCmdletDefinitions.ps1 index be9f23a5774c..c8aa69b4e252 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/internal/ProxyCmdletDefinitions.ps1 +++ b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/internal/ProxyCmdletDefinitions.ps1 @@ -25,12 +25,12 @@ Lists all the supported operations by the Microsoft.ChangeAnalysis resource prov {{ Add code here }} .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDefinition +Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDefinition .Link https://learn.microsoft.com/powershell/module/az.changeanalysis/get-azchangeanalysisoperation #> function Get-AzChangeAnalysisOperation { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.Api20210401.IResourceProviderOperationDefinition])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Models.IResourceProviderOperationDefinition])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter()] @@ -96,12 +96,18 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ChangeAnalysis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ List = 'Az.ChangeAnalysis.private\Get-AzChangeAnalysisOperation_List'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/resources/README.md b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/resources/README.md new file mode 100644 index 000000000000..937f07f8fec2 --- /dev/null +++ b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/resources/README.md @@ -0,0 +1,11 @@ +# Resources +This directory can contain any additional resources for module that are not required at runtime. This directory **does not** get packaged with the module. If you have assets for custom implementation, place them into the `..\custom` folder. + +## Info +- Modifiable: yes +- Generated: no +- Committed: yes +- Packaged: no + +## Purpose +Use this folder to put anything you want to keep around as part of the repository for the module, but is not something that is required for the module. For example, development files, packaged builds, or additional information. This is only intended to be used in repositories where the module's output directory is cleaned, but tangential resources for the module want to remain intact. \ No newline at end of file diff --git a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/test-module.ps1 b/generated/ChangeAnalysis/ChangeAnalysis.Autorest/test-module.ps1 index 753e2f1786b8..28fc977a32b4 100644 --- a/generated/ChangeAnalysis/ChangeAnalysis.Autorest/test-module.ps1 +++ b/generated/ChangeAnalysis/ChangeAnalysis.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/MonitoringSolutions/MonitoringSolutions.Autorest/Az.MonitoringSolutions.csproj b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/Az.MonitoringSolutions.csproj index ec0ae35b85aa..c13b5e65d343 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/Az.MonitoringSolutions.csproj +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/Az.MonitoringSolutions.csproj @@ -2,9 +2,9 @@ MonitoringSolutions MonitoringSolutions + MonitoringSolutions.Autorest - diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/Az.MonitoringSolutions.format.ps1xml b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/Az.MonitoringSolutions.format.ps1xml index 64288f5f6cb0..18f03e0a2b7d 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/Az.MonitoringSolutions.format.ps1xml +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/Az.MonitoringSolutions.format.ps1xml @@ -2,73 +2,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.MonitoringSolutionsIdentity + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ArmTemplateParameter - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.MonitoringSolutionsIdentity - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ManagementAssociationName - - - ManagementConfigurationName - - - ProviderName - - - ResourceGroupName - - - ResourceName - - - ResourceType - - - SolutionName - - - SubscriptionId - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ArmTemplateParameter - - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ArmTemplateParameter + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ArmTemplateParameter#Multiple @@ -94,9 +30,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.CodeMessageErrorAutoGenerated + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.CodeMessageError1 - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.CodeMessageErrorAutoGenerated + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.CodeMessageError1#Multiple @@ -122,9 +58,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ManagementAssociation + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ManagementAssociation - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ManagementAssociation + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ManagementAssociation#Multiple @@ -134,6 +70,9 @@ + + + @@ -144,15 +83,18 @@ Name + + ResourceGroupName + - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ManagementAssociationProperties + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ManagementAssociationProperties - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ManagementAssociationProperties + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ManagementAssociationProperties#Multiple @@ -172,9 +114,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ManagementConfiguration + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ManagementConfiguration - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ManagementConfiguration + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ManagementConfiguration#Multiple @@ -184,6 +126,9 @@ + + + @@ -194,15 +139,18 @@ Name + + ResourceGroupName + - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ManagementConfigurationProperties + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ManagementConfigurationProperties - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ManagementConfigurationProperties + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ManagementConfigurationProperties#Multiple @@ -234,9 +182,73 @@ - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.Operation + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.MonitoringSolutionsIdentity - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.Operation + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.MonitoringSolutionsIdentity#Multiple + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ManagementAssociationName + + + ManagementConfigurationName + + + ProviderName + + + ResourceGroupName + + + ResourceName + + + ResourceType + + + SolutionName + + + SubscriptionId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Operation + + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Operation#Multiple @@ -256,9 +268,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.OperationDisplay + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.OperationDisplay - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.OperationDisplay + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.OperationDisplay#Multiple @@ -290,9 +302,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.Solution + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Solution - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.Solution + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Solution#Multiple @@ -318,9 +330,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.SolutionPatchTags + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.SolutionPatchTags - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.SolutionPatchTags + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.SolutionPatchTags#Multiple @@ -340,9 +352,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.SolutionPlan + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.SolutionPlan - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.SolutionPlan + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.SolutionPlan#Multiple @@ -380,21 +392,15 @@ - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.SolutionProperties + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.SolutionProperties - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.SolutionProperties + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.SolutionProperties#Multiple - - - - - - @@ -402,15 +408,9 @@ - - ContainedResource - ProvisioningState - - ReferencedResource - WorkspaceResourceId @@ -420,9 +420,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.SolutionTags + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.SolutionTags - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.SolutionTags + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.SolutionTags#Multiple diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/Az.MonitoringSolutions.psd1 b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/Az.MonitoringSolutions.psd1 index 7c5124ecb2fc..7d522a785278 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/Az.MonitoringSolutions.psd1 +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/Az.MonitoringSolutions.psd1 @@ -11,8 +11,7 @@ DotNetFrameworkVersion = '4.7.2' RequiredAssemblies = './bin/Az.MonitoringSolutions.private.dll' FormatsToProcess = './Az.MonitoringSolutions.format.ps1xml' - FunctionsToExport = 'Get-AzMonitorLogAnalyticsSolution', 'New-AzMonitorLogAnalyticsSolution', 'Remove-AzMonitorLogAnalyticsSolution', 'Update-AzMonitorLogAnalyticsSolution', '*' - AliasesToExport = '*' + FunctionsToExport = 'Get-AzMonitorLogAnalyticsSolution', 'New-AzMonitorLogAnalyticsSolution', 'Remove-AzMonitorLogAnalyticsSolution', 'Update-AzMonitorLogAnalyticsSolution' PrivateData = @{ PSData = @{ Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'MonitoringSolutions' diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/Properties/AssemblyInfo.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/Properties/AssemblyInfo.cs index 686320b057af..0c7475b67323 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/Properties/AssemblyInfo.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/Properties/AssemblyInfo.cs @@ -1,28 +1,26 @@ -// ---------------------------------------------------------------------------------- -// -// Copyright Microsoft Corporation -// Licensed under the Apache License, Version 2.0 (the "License"); +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the Apache License, Version 2.0 (the ""License""); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, +// distributed under the License is distributed on an ""AS IS"" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// ---------------------------------------------------------------------------------- +// Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code +// is regenerated. using System; using System.Reflection; +using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -[assembly: AssemblyTitle("Microsoft Azure Powershell - MonitoringSolutions")] -[assembly: AssemblyCompany(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCompany)] -[assembly: AssemblyProduct(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyProduct)] -[assembly: AssemblyCopyright(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCopyright)] - -[assembly: ComVisible(false)] -[assembly: CLSCompliant(false)] -[assembly: Guid("2875709f-e867-4725-8f14-ad65210b7c23")] -[assembly: AssemblyVersion("0.1.2")] -[assembly: AssemblyFileVersion("0.1.2")] +[assembly: System.Reflection.AssemblyCompanyAttribute("Microsoft")] +[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")] +[assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")] +[assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - MonitoringSolutions")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("0.1.2")] +[assembly: System.Reflection.AssemblyVersionAttribute("0.1.2")] +[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)] +[assembly: System.CLSCompliantAttribute(false)] diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/check-dependencies.ps1 b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/check-dependencies.ps1 index c29591c7bfe1..90ca9867ae40 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/check-dependencies.ps1 +++ b/generated/MonitoringSolutions/MonitoringSolutions.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/MonitoringSolutions/MonitoringSolutions.Autorest/exports/Get-AzMonitorLogAnalyticsSolution.ps1 b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/exports/Get-AzMonitorLogAnalyticsSolution.ps1 index f53b29577745..968507072e7d 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/exports/Get-AzMonitorLogAnalyticsSolution.ps1 +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/exports/Get-AzMonitorLogAnalyticsSolution.ps1 @@ -34,7 +34,9 @@ Get-AzMonitorLogAnalyticsSolution .Inputs Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IMonitoringSolutionsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolution +Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolution +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPropertiesList .Notes COMPLEX PARAMETER PROPERTIES @@ -54,7 +56,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.monitoringsolutions/get-azmonitorloganalyticssolution #> function Get-AzMonitorLogAnalyticsSolution { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolution])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolution], [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPropertiesList])] [CmdletBinding(DefaultParameterSetName='List1', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -86,7 +88,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IMonitoringSolutionsIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -145,6 +146,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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() @@ -169,9 +179,7 @@ begin { List = 'Az.MonitoringSolutions.private\Get-AzMonitorLogAnalyticsSolution_List'; List1 = 'Az.MonitoringSolutions.private\Get-AzMonitorLogAnalyticsSolution_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.MonitoringSolutions.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 { @@ -185,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/MonitoringSolutions/MonitoringSolutions.Autorest/exports/New-AzMonitorLogAnalyticsSolution.ps1 b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/exports/New-AzMonitorLogAnalyticsSolution.ps1 index dfa78ca48302..5ff3956447c0 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/exports/New-AzMonitorLogAnalyticsSolution.ps1 +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/exports/New-AzMonitorLogAnalyticsSolution.ps1 @@ -23,17 +23,15 @@ Creates a log analytics solution. $workspace = Get-AzOperationalInsightsWorkspace -ResourceGroupName azureps-manual-test -Name monitoringworkspace-2vob7n New-AzMonitorLogAnalyticsSolution -Type Containers -ResourceGroupName azureps-manual-test -Location $workspace.Location -WorkspaceResourceId $workspace.ResourceId +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IMonitoringSolutionsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolution +Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolution .Link https://learn.microsoft.com/powershell/module/az.monitoringsolutions/new-azmonitorloganalyticssolution -.Link - -.Link -[Get-AzOperationalInsightsWorkspace](https://learn.microsoft.com/powershell/module/az.operationalinsights/get-azoperationalinsightsworkspace) #> function New-AzMonitorLogAnalyticsSolution { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolution])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolution])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -74,7 +72,7 @@ param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionTags]))] [System.Collections.Hashtable] # Resource tags ${Tag}, @@ -84,7 +82,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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)] @@ -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.MonitoringSolutions.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 { $mapping = @{ CreateExpanded = 'Az.MonitoringSolutions.custom\New-AzMonitorLogAnalyticsSolution'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded') -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/MonitoringSolutions/MonitoringSolutions.Autorest/exports/ProxyCmdletDefinitions.ps1 b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/exports/ProxyCmdletDefinitions.ps1 index 025fcbe07b13..3cecbf56e212 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/exports/ProxyCmdletDefinitions.ps1 +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/exports/ProxyCmdletDefinitions.ps1 @@ -34,7 +34,9 @@ Get-AzMonitorLogAnalyticsSolution .Inputs Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IMonitoringSolutionsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolution +Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolution +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPropertiesList .Notes COMPLEX PARAMETER PROPERTIES @@ -54,7 +56,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.monitoringsolutions/get-azmonitorloganalyticssolution #> function Get-AzMonitorLogAnalyticsSolution { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolution])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolution], [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPropertiesList])] [CmdletBinding(DefaultParameterSetName='List1', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -86,7 +88,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IMonitoringSolutionsIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -145,6 +146,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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() @@ -169,9 +179,7 @@ begin { List = 'Az.MonitoringSolutions.private\Get-AzMonitorLogAnalyticsSolution_List'; List1 = 'Az.MonitoringSolutions.private\Get-AzMonitorLogAnalyticsSolution_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.MonitoringSolutions.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 { @@ -185,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) @@ -293,7 +304,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IMonitoringSolutionsIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -358,6 +368,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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() @@ -380,9 +399,7 @@ begin { Delete = 'Az.MonitoringSolutions.private\Remove-AzMonitorLogAnalyticsSolution_Delete'; DeleteViaIdentity = 'Az.MonitoringSolutions.private\Remove-AzMonitorLogAnalyticsSolution_DeleteViaIdentity'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 { @@ -396,6 +413,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) @@ -441,9 +461,9 @@ end { <# .Synopsis -Update the tags of a solution. +update the tags of a solution. .Description -Update the tags of a solution. +update the tags of a solution. .Example Update-AzMonitorLogAnalyticsSolution -ResourceGroupName lucas-manual-test -Name 'Containers(monitoringworkspace-2vob7n)' -Tag @{'Operation'='update';'Param'='Tag'} .Example @@ -453,7 +473,7 @@ Update-AzMonitorLogAnalyticsSolution -InputObject $monitor -Tag @{'Operation'='u .Inputs Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IMonitoringSolutionsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolution +Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolution .Notes COMPLEX PARAMETER PROPERTIES @@ -473,7 +493,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.monitoringsolutions/update-azmonitorloganalyticssolution #> function Update-AzMonitorLogAnalyticsSolution { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolution])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolution])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] @@ -502,12 +522,11 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IMonitoringSolutionsIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPatchTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPatchTags]))] [System.Collections.Hashtable] # Resource tags ${Tag}, @@ -568,6 +587,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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() @@ -590,9 +618,7 @@ begin { UpdateExpanded = 'Az.MonitoringSolutions.private\Update-AzMonitorLogAnalyticsSolution_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.MonitoringSolutions.private\Update-AzMonitorLogAnalyticsSolution_UpdateViaIdentityExpanded'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 { @@ -606,6 +632,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) @@ -658,17 +687,15 @@ Creates a log analytics solution. $workspace = Get-AzOperationalInsightsWorkspace -ResourceGroupName azureps-manual-test -Name monitoringworkspace-2vob7n New-AzMonitorLogAnalyticsSolution -Type Containers -ResourceGroupName azureps-manual-test -Location $workspace.Location -WorkspaceResourceId $workspace.ResourceId +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IMonitoringSolutionsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolution +Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolution .Link https://learn.microsoft.com/powershell/module/az.monitoringsolutions/new-azmonitorloganalyticssolution -.Link - -.Link -[Get-AzOperationalInsightsWorkspace](https://learn.microsoft.com/powershell/module/az.operationalinsights/get-azoperationalinsightsworkspace) #> function New-AzMonitorLogAnalyticsSolution { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolution])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolution])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -709,7 +736,7 @@ param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionTags]))] [System.Collections.Hashtable] # Resource tags ${Tag}, @@ -719,7 +746,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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)] @@ -769,6 +797,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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() @@ -790,9 +827,7 @@ begin { $mapping = @{ CreateExpanded = 'Az.MonitoringSolutions.custom\New-AzMonitorLogAnalyticsSolution'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -806,6 +841,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/MonitoringSolutions/MonitoringSolutions.Autorest/exports/Remove-AzMonitorLogAnalyticsSolution.ps1 b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/exports/Remove-AzMonitorLogAnalyticsSolution.ps1 index 376a1c13e961..3b7ef2c39306 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/exports/Remove-AzMonitorLogAnalyticsSolution.ps1 +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/exports/Remove-AzMonitorLogAnalyticsSolution.ps1 @@ -79,7 +79,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IMonitoringSolutionsIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -144,6 +143,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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() @@ -166,9 +174,7 @@ begin { Delete = 'Az.MonitoringSolutions.private\Remove-AzMonitorLogAnalyticsSolution_Delete'; DeleteViaIdentity = 'Az.MonitoringSolutions.private\Remove-AzMonitorLogAnalyticsSolution_DeleteViaIdentity'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 { @@ -182,6 +188,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/exports/Update-AzMonitorLogAnalyticsSolution.ps1 b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/exports/Update-AzMonitorLogAnalyticsSolution.ps1 index d9d312938fa7..38e4749053a3 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/exports/Update-AzMonitorLogAnalyticsSolution.ps1 +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/exports/Update-AzMonitorLogAnalyticsSolution.ps1 @@ -16,9 +16,9 @@ <# .Synopsis -Update the tags of a solution. +update the tags of a solution. .Description -Update the tags of a solution. +update the tags of a solution. .Example Update-AzMonitorLogAnalyticsSolution -ResourceGroupName lucas-manual-test -Name 'Containers(monitoringworkspace-2vob7n)' -Tag @{'Operation'='update';'Param'='Tag'} .Example @@ -28,7 +28,7 @@ Update-AzMonitorLogAnalyticsSolution -InputObject $monitor -Tag @{'Operation'='u .Inputs Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IMonitoringSolutionsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolution +Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolution .Notes COMPLEX PARAMETER PROPERTIES @@ -48,7 +48,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.monitoringsolutions/update-azmonitorloganalyticssolution #> function Update-AzMonitorLogAnalyticsSolution { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolution])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolution])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] @@ -77,12 +77,11 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IMonitoringSolutionsIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPatchTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPatchTags]))] [System.Collections.Hashtable] # Resource tags ${Tag}, @@ -143,6 +142,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -165,9 +173,7 @@ begin { UpdateExpanded = 'Az.MonitoringSolutions.private\Update-AzMonitorLogAnalyticsSolution_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.MonitoringSolutions.private\Update-AzMonitorLogAnalyticsSolution_UpdateViaIdentityExpanded'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 { @@ -181,6 +187,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/MonitoringSolutions/MonitoringSolutions.Autorest/generate-info.json b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generate-info.json index a295dbd0d757..656a7fd79895 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generate-info.json +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generate-info.json @@ -1,3 +1,3 @@ { - "generate_Id": "dcbd66ba-7ce8-4e55-ab03-e426736a30af" + "generate_Id": "0f52014a-cf5f-4a75-a510-d654b383d47c" } diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/Module.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/Module.cs index 3729fc36856f..ed07ca3ea4b7 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/Module.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.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.MonitoringSolutions.Module _instance; + /// the ISendAsync pipeline instance private Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.HttpPipeline _pipeline; /// the ISendAsync pipeline instance (when proxy is enabled) private Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.HttpPipeline _pipelineWithProxy; + private static readonly global::System.Object _singletonLock = new global::System.Object(); + public bool _useProxy = false; public global::System.Net.WebProxy _webProxy = new global::System.Net.WebProxy(); @@ -56,11 +64,8 @@ public partial class Module /// The delegate to get the telemetry info. public GetTelemetryInfoDelegate GetTelemetryInfo { get; set; } - /// Backing field for property. - private static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Module _instance; - /// the singleton of this module class - public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Module Instance => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Module._instance?? (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Module._instance = new Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Module()); + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions"; @@ -125,9 +130,17 @@ public Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.HttpPipeli /// 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/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Any.PowerShell.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Any.PowerShell.cs index 1227110503e2..cfa7c3f5d523 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Any.PowerShell.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Any.PowerShell.cs @@ -7,7 +7,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.PowerShell; - /// Any object + /// Anything [System.ComponentModel.TypeConverter(typeof(AnyTypeConverter))] public partial class Any { @@ -54,6 +54,14 @@ public partial class Any 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 . @@ -125,8 +133,20 @@ public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IAny /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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(); + } } - /// Any object + /// Anything [System.ComponentModel.TypeConverter(typeof(AnyTypeConverter))] public partial interface IAny diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Any.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Any.cs index 1559e74ad7f0..3064fa74bd69 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Any.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Any.cs @@ -7,7 +7,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Extensions; - /// Any object + /// Anything public partial class Any : Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IAny, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IAnyInternal @@ -19,13 +19,13 @@ public Any() } } - /// Any object + /// Anything public partial interface IAny : Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IJsonSerializable { } - /// Any object + /// Anything internal partial interface IAnyInternal { diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Any.json.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Any.json.cs index fd5d7128d467..82a95c70c591 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Any.json.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Any.json.cs @@ -7,7 +7,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Extensions; - /// Any object + /// Anything public partial class Any { diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ArmTemplateParameter.PowerShell.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ArmTemplateParameter.PowerShell.cs similarity index 73% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ArmTemplateParameter.PowerShell.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ArmTemplateParameter.PowerShell.cs index b6c193bdb68d..1ed50d8e9d55 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ArmTemplateParameter.PowerShell.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ArmTemplateParameter.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.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.PowerShell; @@ -55,7 +55,15 @@ public partial class ArmTemplateParameter 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 ArmTemplateParameter(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IArmTemplateParameterInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IArmTemplateParameterInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IArmTemplateParameterInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IArmTemplateParameterInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IArmTemplateParameterInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IArmTemplateParameterInternal)this).Value, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IArmTemplateParameterInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IArmTemplateParameterInternal)this).Value, 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 ArmTemplateParameter(global::System.Management.Automation.PSObject cont // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IArmTemplateParameterInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IArmTemplateParameterInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IArmTemplateParameterInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IArmTemplateParameterInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IArmTemplateParameterInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IArmTemplateParameterInternal)this).Value, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IArmTemplateParameterInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IArmTemplateParameterInternal)this).Value, 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.MonitoringSolutions.Models.Api20151101Preview.IArmTemplateParameter DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IArmTemplateParameter DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ArmTemplateParameter(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.MonitoringSolutions.Models.Api20151101Preview.IArmTemplateParameter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IArmTemplateParameter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ArmTemplateParameter(content); } @@ -137,12 +143,24 @@ public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api2 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IArmTemplateParameter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IArmTemplateParameter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.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(); + } } /// Parameter to pass to ARM template [System.ComponentModel.TypeConverter(typeof(ArmTemplateParameterTypeConverter))] diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ArmTemplateParameter.TypeConverter.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ArmTemplateParameter.TypeConverter.cs similarity index 97% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ArmTemplateParameter.TypeConverter.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ArmTemplateParameter.TypeConverter.cs index 3c3c3acbc39d..19ddf0d9d551 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ArmTemplateParameter.TypeConverter.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ArmTemplateParameter.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.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Models.Api20151101Preview.IArmTemplateParameter ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IArmTemplateParameter ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IArmTemplateParameter).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IArmTemplateParameter).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ArmTemplateParameter.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ArmTemplateParameter.cs similarity index 93% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ArmTemplateParameter.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ArmTemplateParameter.cs index d6f582e2e52a..7856b5c54940 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ArmTemplateParameter.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ArmTemplateParameter.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.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Extensions; /// Parameter to pass to ARM template public partial class ArmTemplateParameter : - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IArmTemplateParameter, - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IArmTemplateParameterInternal + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IArmTemplateParameter, + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IArmTemplateParameterInternal { /// Backing field for property. @@ -41,6 +41,9 @@ public partial interface IArmTemplateParameter : [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"name of the parameter.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -49,6 +52,9 @@ public partial interface IArmTemplateParameter : [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"value for the parameter. In Jtoken ", SerializedName = @"value", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ArmTemplateParameter.json.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ArmTemplateParameter.json.cs similarity index 94% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ArmTemplateParameter.json.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ArmTemplateParameter.json.cs index 0254e3891755..79c4ebfec126 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ArmTemplateParameter.json.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ArmTemplateParameter.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.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Extensions; @@ -65,19 +65,19 @@ internal ArmTemplateParameter(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolut { return; } - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)Value;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)_value;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IArmTemplateParameter. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IArmTemplateParameter. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IArmTemplateParameter. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IArmTemplateParameter. /// - public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IArmTemplateParameter FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IArmTemplateParameter FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonObject json ? new ArmTemplateParameter(json) : null; } diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/CodeMessageError.PowerShell.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/CodeMessageError.PowerShell.cs similarity index 69% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/CodeMessageError.PowerShell.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/CodeMessageError.PowerShell.cs index 1b005462728c..2dcf891579d2 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/CodeMessageError.PowerShell.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/CodeMessageError.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.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.PowerShell; @@ -55,7 +55,15 @@ public partial class CodeMessageError 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 CodeMessageError(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Error")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageErrorInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageErrorAutoGenerated) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageErrorInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.CodeMessageErrorAutoGeneratedTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageErrorInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageError1) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageErrorInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.CodeMessageError1TypeConverter.ConvertFrom); } if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageErrorInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageErrorInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageErrorInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageErrorInternal)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 CodeMessageError(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Error")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageErrorInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageErrorAutoGenerated) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageErrorInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.CodeMessageErrorAutoGeneratedTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageErrorInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageError1) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageErrorInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.CodeMessageError1TypeConverter.ConvertFrom); } if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageErrorInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageErrorInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageErrorInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageErrorInternal)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.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageError DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageError DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new CodeMessageError(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.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new CodeMessageError(content); } @@ -145,12 +151,24 @@ public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api2 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.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 error body contract. [System.ComponentModel.TypeConverter(typeof(CodeMessageErrorTypeConverter))] diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/CodeMessageError.TypeConverter.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/CodeMessageError.TypeConverter.cs similarity index 97% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/CodeMessageError.TypeConverter.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/CodeMessageError.TypeConverter.cs index 15c4aecde2c4..d1884675dcc1 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/CodeMessageError.TypeConverter.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/CodeMessageError.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.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageError ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageError ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageError).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageError).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/CodeMessageError.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/CodeMessageError.cs similarity index 69% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/CodeMessageError.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/CodeMessageError.cs index baf78e199751..ca714b5ae5a7 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/CodeMessageError.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/CodeMessageError.cs @@ -3,33 +3,33 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Extensions; /// The error body contract. public partial class CodeMessageError : - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageError, - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageErrorInternal + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageError, + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageErrorInternal { /// The error type. [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Origin(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.PropertyOrigin.Inlined)] - public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageErrorAutoGeneratedInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageErrorAutoGeneratedInternal)Error).Code = value ?? null; } + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageError1Internal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageError1Internal)Error).Code = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageErrorAutoGenerated _error; + private Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageError1 _error; /// The error details for a failed request. [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Origin(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageErrorAutoGenerated Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.CodeMessageErrorAutoGenerated()); set => this._error = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageError1 Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.CodeMessageError1()); set => this._error = value; } /// The error message. [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Origin(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.PropertyOrigin.Inlined)] - public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageErrorAutoGeneratedInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageErrorAutoGeneratedInternal)Error).Message = value ?? null; } + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageError1Internal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageError1Internal)Error).Message = value ?? null; } /// Internal Acessors for Error - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageErrorAutoGenerated Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageErrorInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.CodeMessageErrorAutoGenerated()); set { {_error = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageError1 Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageErrorInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.CodeMessageError1()); set { {_error = value;} } } /// Creates an new instance. public CodeMessageError() @@ -45,6 +45,9 @@ public partial interface ICodeMessageError : [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The error type.", SerializedName = @"code", PossibleTypes = new [] { typeof(string) })] @@ -53,6 +56,9 @@ public partial interface ICodeMessageError : [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The error message.", SerializedName = @"message", PossibleTypes = new [] { typeof(string) })] @@ -66,7 +72,7 @@ internal partial interface ICodeMessageErrorInternal /// The error type. string Code { get; set; } /// The error details for a failed request. - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageErrorAutoGenerated Error { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageError1 Error { get; set; } /// The error message. string Message { get; set; } diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/CodeMessageError.json.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/CodeMessageError.json.cs similarity index 94% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/CodeMessageError.json.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/CodeMessageError.json.cs index e7cf4eb80d6a..7ebf7a5fe730 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/CodeMessageError.json.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/CodeMessageError.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.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Extensions; @@ -65,18 +65,18 @@ internal CodeMessageError(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions { return; } - {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.CodeMessageErrorAutoGenerated.FromJson(__jsonError) : Error;} + {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.CodeMessageError1.FromJson(__jsonError) : _error;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageError. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageError. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageError. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageError. /// - public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageError FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageError FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonObject json ? new CodeMessageError(json) : null; } diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/CodeMessageErrorAutoGenerated.PowerShell.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/CodeMessageError1.PowerShell.cs similarity index 68% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/CodeMessageErrorAutoGenerated.PowerShell.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/CodeMessageError1.PowerShell.cs index 1521c54c8f07..c9f35f0302e8 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/CodeMessageErrorAutoGenerated.PowerShell.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/CodeMessageError1.PowerShell.cs @@ -3,13 +3,13 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.PowerShell; /// The error details for a failed request. - [System.ComponentModel.TypeConverter(typeof(CodeMessageErrorAutoGeneratedTypeConverter))] - public partial class CodeMessageErrorAutoGenerated + [System.ComponentModel.TypeConverter(typeof(CodeMessageError1TypeConverter))] + public partial class CodeMessageError1 { /// @@ -55,11 +55,19 @@ public partial class CodeMessageErrorAutoGenerated 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. - internal CodeMessageErrorAutoGenerated(global::System.Collections.IDictionary content) + internal CodeMessageError1(global::System.Collections.IDictionary content) { bool returnNow = false; BeforeDeserializeDictionary(content, ref returnNow); @@ -70,21 +78,21 @@ internal CodeMessageErrorAutoGenerated(global::System.Collections.IDictionary co // actually deserialize if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageErrorAutoGeneratedInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageErrorAutoGeneratedInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageError1Internal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageError1Internal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageErrorAutoGeneratedInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageErrorAutoGeneratedInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageError1Internal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageError1Internal)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. - internal CodeMessageErrorAutoGenerated(global::System.Management.Automation.PSObject content) + internal CodeMessageError1(global::System.Management.Automation.PSObject content) { bool returnNow = false; BeforeDeserializePSObject(content, ref returnNow); @@ -95,58 +103,68 @@ internal CodeMessageErrorAutoGenerated(global::System.Management.Automation.PSOb // actually deserialize if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageErrorAutoGeneratedInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageErrorAutoGeneratedInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageError1Internal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageError1Internal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageErrorAutoGeneratedInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageErrorAutoGeneratedInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageError1Internal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageError1Internal)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.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageErrorAutoGenerated DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageError1 DeserializeFromDictionary(global::System.Collections.IDictionary content) { - return new CodeMessageErrorAutoGenerated(content); + return new CodeMessageError1(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.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageErrorAutoGenerated DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageError1 DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { - return new CodeMessageErrorAutoGenerated(content); + return new CodeMessageError1(content); } /// - /// Creates a new instance of , deserializing the content from a json string. + /// 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.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageErrorAutoGenerated FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(jsonText)); + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageError1 FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.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 error details for a failed request. - [System.ComponentModel.TypeConverter(typeof(CodeMessageErrorAutoGeneratedTypeConverter))] - public partial interface ICodeMessageErrorAutoGenerated + [System.ComponentModel.TypeConverter(typeof(CodeMessageError1TypeConverter))] + public partial interface ICodeMessageError1 { diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/CodeMessageErrorAutoGenerated.TypeConverter.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/CodeMessageError1.TypeConverter.cs similarity index 83% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/CodeMessageErrorAutoGenerated.TypeConverter.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/CodeMessageError1.TypeConverter.cs index 6a5aaa94acd7..8f2ab44aa069 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/CodeMessageErrorAutoGenerated.TypeConverter.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/CodeMessageError1.TypeConverter.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.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.PowerShell; /// - /// A PowerShell PSTypeConverter to support converting to an instance of + /// A PowerShell PSTypeConverter to support converting to an instance of /// - public partial class CodeMessageErrorAutoGeneratedTypeConverter : global::System.Management.Automation.PSTypeConverter + public partial class CodeMessageError1TypeConverter : global::System.Management.Automation.PSTypeConverter { /// @@ -26,13 +26,13 @@ public partial class CodeMessageErrorAutoGeneratedTypeConverter : global::System public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); /// - /// Determines if the converter can convert the parameter to the + /// Determines if the converter can convert the parameter to the /// type. /// - /// the instance to check if it can be converted to the the instance to check if it can be converted to the type. /// - /// true if the instance could be converted to a type, otherwise false + /// true if the instance could be converted to a type, otherwise false /// public static bool CanConvertFrom(dynamic sourceValue) { @@ -95,31 +95,31 @@ public static bool CanConvertFrom(dynamic sourceValue) /// 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. + /// 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) => ConvertFrom(sourceValue); /// - /// Converts the parameter into an instance of + /// Converts the parameter into an instance of /// - /// the value to convert into an instance of . + /// the value to convert into an instance of . /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageErrorAutoGenerated ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageError1 ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageErrorAutoGenerated).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageError1).IsAssignableFrom(type)) { return sourceValue; } try { - return CodeMessageErrorAutoGenerated.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + return CodeMessageError1.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; } catch { @@ -127,11 +127,11 @@ public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api2 } if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) { - return CodeMessageErrorAutoGenerated.DeserializeFromPSObject(sourceValue); + return CodeMessageError1.DeserializeFromPSObject(sourceValue); } if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) { - return CodeMessageErrorAutoGenerated.DeserializeFromDictionary(sourceValue); + return CodeMessageError1.DeserializeFromDictionary(sourceValue); } return null; } diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/CodeMessageErrorAutoGenerated.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/CodeMessageError1.cs similarity index 84% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/CodeMessageErrorAutoGenerated.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/CodeMessageError1.cs index f4d4f1191c19..0e9924679bb9 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/CodeMessageErrorAutoGenerated.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/CodeMessageError1.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.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Extensions; /// The error details for a failed request. - public partial class CodeMessageErrorAutoGenerated : - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageErrorAutoGenerated, - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageErrorAutoGeneratedInternal + public partial class CodeMessageError1 : + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageError1, + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageError1Internal { /// Backing field for property. @@ -27,20 +27,23 @@ public partial class CodeMessageErrorAutoGenerated : [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Origin(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.PropertyOrigin.Owned)] public string Message { get => this._message; set => this._message = value; } - /// Creates an new instance. - public CodeMessageErrorAutoGenerated() + /// Creates an new instance. + public CodeMessageError1() { } } /// The error details for a failed request. - public partial interface ICodeMessageErrorAutoGenerated : + public partial interface ICodeMessageError1 : Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IJsonSerializable { /// The error type. [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The error type.", SerializedName = @"code", PossibleTypes = new [] { typeof(string) })] @@ -49,6 +52,9 @@ public partial interface ICodeMessageErrorAutoGenerated : [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The error message.", SerializedName = @"message", PossibleTypes = new [] { typeof(string) })] @@ -56,7 +62,7 @@ public partial interface ICodeMessageErrorAutoGenerated : } /// The error details for a failed request. - internal partial interface ICodeMessageErrorAutoGeneratedInternal + internal partial interface ICodeMessageError1Internal { /// The error type. diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/CodeMessageErrorAutoGenerated.json.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/CodeMessageError1.json.cs similarity index 88% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/CodeMessageErrorAutoGenerated.json.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/CodeMessageError1.json.cs index a27eec265ed2..fc2c3f3c484a 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/CodeMessageErrorAutoGenerated.json.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/CodeMessageError1.json.cs @@ -3,12 +3,12 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Extensions; /// The error details for a failed request. - public partial class CodeMessageErrorAutoGenerated + public partial class CodeMessageError1 { /// @@ -54,10 +54,10 @@ public partial class CodeMessageErrorAutoGenerated partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonObject into a new instance of . + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonObject into a new instance of . /// /// A Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonObject instance to deserialize from. - internal CodeMessageErrorAutoGenerated(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonObject json) + internal CodeMessageError1(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonObject json) { bool returnNow = false; BeforeFromJson(json, ref returnNow); @@ -65,31 +65,31 @@ internal CodeMessageErrorAutoGenerated(Microsoft.Azure.PowerShell.Cmdlets.Monito { 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.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageErrorAutoGenerated. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageError1. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageErrorAutoGenerated. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageError1. /// - public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageErrorAutoGenerated FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageError1 FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode node) { - return node is Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonObject json ? new CodeMessageErrorAutoGenerated(json) : null; + return node is Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonObject json ? new CodeMessageError1(json) : null; } /// - /// Serializes this instance of into a . + /// Serializes this instance of into a . /// /// The container to serialize this object into. If the caller /// passes in null, a new instance will be created and returned to the caller. /// Allows the caller to choose the depth of the serialization. See . /// - /// a serialized instance of as a . + /// a serialized instance of as a . /// public Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode serializationMode) { diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementAssociation.PowerShell.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementAssociation.PowerShell.cs similarity index 62% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementAssociation.PowerShell.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementAssociation.PowerShell.cs index 36a20e354f20..608d9a86fbf8 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementAssociation.PowerShell.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementAssociation.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.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class ManagementAssociation 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.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociation DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociation DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ManagementAssociation(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.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ManagementAssociation(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api2 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 +111,33 @@ internal ManagementAssociation(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ManagementAssociationPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ManagementAssociationPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociationInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociationInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociationInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociationInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociationInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociationInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociationInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociationInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociationInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociationInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociationInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociationInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociationInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociationInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("ApplicationId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociationInternal)this).ApplicationId = (string) content.GetValueForProperty("ApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociationInternal)this).ApplicationId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociationInternal)this).ApplicationId = (string) content.GetValueForProperty("ApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociationInternal)this).ApplicationId, 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 +152,27 @@ internal ManagementAssociation(global::System.Management.Automation.PSObject con // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ManagementAssociationPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ManagementAssociationPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociationInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociationInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociationInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociationInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociationInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociationInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociationInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociationInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociationInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociationInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociationInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociationInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociationInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociationInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("ApplicationId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociationInternal)this).ApplicationId = (string) content.GetValueForProperty("ApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociationInternal)this).ApplicationId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociationInternal)this).ApplicationId = (string) content.GetValueForProperty("ApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociationInternal)this).ApplicationId, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -175,6 +181,18 @@ internal ManagementAssociation(global::System.Management.Automation.PSObject con /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 container for solution. [System.ComponentModel.TypeConverter(typeof(ManagementAssociationTypeConverter))] diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementAssociation.TypeConverter.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementAssociation.TypeConverter.cs similarity index 97% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementAssociation.TypeConverter.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementAssociation.TypeConverter.cs index c679b7d93d3c..291b6663e495 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementAssociation.TypeConverter.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementAssociation.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.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociation ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociation ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociation).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociation).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementAssociation.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementAssociation.cs similarity index 72% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementAssociation.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementAssociation.cs index b033c96b63a1..89c58abf6bad 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementAssociation.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementAssociation.cs @@ -3,19 +3,19 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Extensions; /// The container for solution. public partial class ManagementAssociation : - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociation, - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociationInternal + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociation, + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociationInternal { /// The applicationId of the appliance for this association. [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Origin(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.PropertyOrigin.Inlined)] - public string ApplicationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociationPropertiesInternal)Property).ApplicationId; set => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociationPropertiesInternal)Property).ApplicationId = value ?? null; } + public string ApplicationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociationPropertiesInternal)Property).ApplicationId; set => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociationPropertiesInternal)Property).ApplicationId = value ?? null; } /// Backing field for property. private string _id; @@ -32,16 +32,16 @@ public partial class ManagementAssociation : public string Location { get => this._location; set => this._location = value; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociationInternal.Id { get => this._id; set { {_id = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociationInternal.Id { get => this._id; set { {_id = value;} } } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociationInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociationInternal.Name { get => this._name; set { {_name = value;} } } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociationProperties Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociationInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ManagementAssociationProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociationProperties Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociationInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ManagementAssociationProperties()); set { {_property = value;} } } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociationInternal.Type { get => this._type; set { {_type = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociationInternal.Type { get => this._type; set { {_type = value;} } } /// Backing field for property. private string _name; @@ -51,13 +51,17 @@ public partial class ManagementAssociation : public string Name { get => this._name; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociationProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociationProperties _property; /// /// Properties for ManagementAssociation object supported by the OperationsManagement resource provider. /// [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Origin(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociationProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ManagementAssociationProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociationProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ManagementAssociationProperties()); set => this._property = value; } + + /// Gets the resource group name + [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Origin(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 string _type; @@ -80,6 +84,9 @@ public partial interface IManagementAssociation : [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The applicationId of the appliance for this association.", SerializedName = @"applicationId", PossibleTypes = new [] { typeof(string) })] @@ -88,6 +95,9 @@ public partial interface IManagementAssociation : [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Resource ID.", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -96,6 +106,9 @@ public partial interface IManagementAssociation : [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Resource location", SerializedName = @"location", PossibleTypes = new [] { typeof(string) })] @@ -104,6 +117,9 @@ public partial interface IManagementAssociation : [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Resource name.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -112,6 +128,9 @@ public partial interface IManagementAssociation : [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Resource type.", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -133,7 +152,7 @@ internal partial interface IManagementAssociationInternal /// /// Properties for ManagementAssociation object supported by the OperationsManagement resource provider. /// - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociationProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociationProperties Property { get; set; } /// Resource type. string Type { get; set; } diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementAssociation.json.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementAssociation.json.cs similarity index 93% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementAssociation.json.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementAssociation.json.cs index 58496bf58f48..75603fbea674 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementAssociation.json.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementAssociation.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.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ManagementAssociation partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociation. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociation. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociation. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociation. /// - public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociation FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociation FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonObject json ? new ManagementAssociation(json) : null; } @@ -77,11 +77,11 @@ internal ManagementAssociation(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolu { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ManagementAssociationProperties.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;} - {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)Location;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ManagementAssociationProperties.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;} + {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)_location;} AfterFromJson(json); } @@ -105,15 +105,15 @@ public Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonN return container; } AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); } diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementAssociationProperties.PowerShell.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementAssociationProperties.PowerShell.cs similarity index 76% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementAssociationProperties.PowerShell.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementAssociationProperties.PowerShell.cs index 3a73c99e0dad..0d734b83164a 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementAssociationProperties.PowerShell.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementAssociationProperties.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.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.PowerShell; @@ -57,29 +57,37 @@ public partial class ManagementAssociationProperties 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.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociationProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociationProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ManagementAssociationProperties(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.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociationProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociationProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ManagementAssociationProperties(content); } @@ -89,10 +97,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api2 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociationProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociationProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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,13 +115,13 @@ internal ManagementAssociationProperties(global::System.Collections.IDictionary // actually deserialize if (content.Contains("ApplicationId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociationPropertiesInternal)this).ApplicationId = (string) content.GetValueForProperty("ApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociationPropertiesInternal)this).ApplicationId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociationPropertiesInternal)this).ApplicationId = (string) content.GetValueForProperty("ApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociationPropertiesInternal)this).ApplicationId, 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. @@ -128,7 +136,7 @@ internal ManagementAssociationProperties(global::System.Management.Automation.PS // actually deserialize if (content.Contains("ApplicationId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociationPropertiesInternal)this).ApplicationId = (string) content.GetValueForProperty("ApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociationPropertiesInternal)this).ApplicationId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociationPropertiesInternal)this).ApplicationId = (string) content.GetValueForProperty("ApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociationPropertiesInternal)this).ApplicationId, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -137,6 +145,18 @@ internal ManagementAssociationProperties(global::System.Management.Automation.PS /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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(); + } } /// ManagementAssociation properties supported by the OperationsManagement resource provider. [System.ComponentModel.TypeConverter(typeof(ManagementAssociationPropertiesTypeConverter))] diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementAssociationProperties.TypeConverter.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementAssociationProperties.TypeConverter.cs similarity index 97% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementAssociationProperties.TypeConverter.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementAssociationProperties.TypeConverter.cs index 1ca1d9d13bf9..c83079cf0104 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementAssociationProperties.TypeConverter.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementAssociationProperties.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.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociationProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociationProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociationProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociationProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementAssociationProperties.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementAssociationProperties.cs similarity index 93% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementAssociationProperties.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementAssociationProperties.cs index 3d25fcf81374..b60bbfa0afee 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementAssociationProperties.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementAssociationProperties.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Extensions; @@ -11,8 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151 /// ManagementAssociation properties supported by the OperationsManagement resource provider. /// public partial class ManagementAssociationProperties : - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociationProperties, - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociationPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociationProperties, + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociationPropertiesInternal { /// Backing field for property. @@ -36,6 +36,9 @@ public partial interface IManagementAssociationProperties : [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The applicationId of the appliance for this association.", SerializedName = @"applicationId", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementAssociationProperties.json.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementAssociationProperties.json.cs similarity index 95% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementAssociationProperties.json.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementAssociationProperties.json.cs index 288730ecfe62..8f50ad90c80c 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementAssociationProperties.json.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementAssociationProperties.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.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class ManagementAssociationProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociationProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociationProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociationProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociationProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociationProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociationProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonObject json ? new ManagementAssociationProperties(json) : null; } @@ -79,7 +79,7 @@ internal ManagementAssociationProperties(Microsoft.Azure.PowerShell.Cmdlets.Moni { return; } - {_applicationId = If( json?.PropertyT("applicationId"), out var __jsonApplicationId) ? (string)__jsonApplicationId : (string)ApplicationId;} + {_applicationId = If( json?.PropertyT("applicationId"), out var __jsonApplicationId) ? (string)__jsonApplicationId : (string)_applicationId;} AfterFromJson(json); } diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementAssociationPropertiesList.PowerShell.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementAssociationPropertiesList.PowerShell.cs similarity index 71% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementAssociationPropertiesList.PowerShell.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementAssociationPropertiesList.PowerShell.cs index 0093244b5c4f..552403017c2f 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementAssociationPropertiesList.PowerShell.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementAssociationPropertiesList.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.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class ManagementAssociationPropertiesList 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.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociationPropertiesList DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociationPropertiesList DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ManagementAssociationPropertiesList(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.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociationPropertiesList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociationPropertiesList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ManagementAssociationPropertiesList(content); } @@ -89,10 +97,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api2 /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociationPropertiesList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociationPropertiesList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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,13 +115,13 @@ internal ManagementAssociationPropertiesList(global::System.Collections.IDiction // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociationPropertiesListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociation[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociationPropertiesListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ManagementAssociationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociationPropertiesListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociationPropertiesListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ManagementAssociationTypeConverter.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. @@ -128,7 +136,7 @@ internal ManagementAssociationPropertiesList(global::System.Management.Automatio // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociationPropertiesListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociation[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociationPropertiesListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ManagementAssociationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociationPropertiesListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociationPropertiesListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ManagementAssociationTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } @@ -137,6 +145,18 @@ internal ManagementAssociationPropertiesList(global::System.Management.Automatio /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 list of ManagementAssociation response [System.ComponentModel.TypeConverter(typeof(ManagementAssociationPropertiesListTypeConverter))] diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementAssociationPropertiesList.TypeConverter.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementAssociationPropertiesList.TypeConverter.cs similarity index 96% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementAssociationPropertiesList.TypeConverter.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementAssociationPropertiesList.TypeConverter.cs index 7b79d2cc20a4..c0cb86935212 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementAssociationPropertiesList.TypeConverter.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementAssociationPropertiesList.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.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociationPropertiesList ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociationPropertiesList ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociationPropertiesList).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociationPropertiesList).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementAssociationPropertiesList.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementAssociationPropertiesList.cs similarity index 71% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementAssociationPropertiesList.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementAssociationPropertiesList.cs index cca6127bcad2..5466acc0cefb 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementAssociationPropertiesList.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementAssociationPropertiesList.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.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Extensions; /// the list of ManagementAssociation response public partial class ManagementAssociationPropertiesList : - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociationPropertiesList, - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociationPropertiesListInternal + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociationPropertiesList, + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociationPropertiesListInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociation[] _value; + private System.Collections.Generic.List _value; /// List of Management Association properties within the subscription. [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Origin(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociation[] 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 ManagementAssociationPropertiesList() @@ -34,10 +34,13 @@ public partial interface IManagementAssociationPropertiesList : [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"List of Management Association properties within the subscription.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociation) })] - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociation[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociation) })] + System.Collections.Generic.List Value { get; set; } } /// the list of ManagementAssociation response @@ -45,7 +48,7 @@ internal partial interface IManagementAssociationPropertiesListInternal { /// List of Management Association properties within the subscription. - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociation[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementAssociationPropertiesList.json.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementAssociationPropertiesList.json.cs similarity index 89% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementAssociationPropertiesList.json.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementAssociationPropertiesList.json.cs index 81693fddeffe..8036ff5c4dd7 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementAssociationPropertiesList.json.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementAssociationPropertiesList.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.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ManagementAssociationPropertiesList partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociationPropertiesList. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociationPropertiesList. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociationPropertiesList. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociationPropertiesList. /// - public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociationPropertiesList FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociationPropertiesList FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonObject json ? new ManagementAssociationPropertiesList(json) : null; } @@ -77,7 +77,7 @@ internal ManagementAssociationPropertiesList(Microsoft.Azure.PowerShell.Cmdlets. { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociation) (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ManagementAssociation.FromJson(__u) )) ))() : null : Value;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Models.IManagementAssociation) (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ManagementAssociation.FromJson(__u) )) ))() : null : _value;} AfterFromJson(json); } diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementConfiguration.PowerShell.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementConfiguration.PowerShell.cs similarity index 53% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementConfiguration.PowerShell.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementConfiguration.PowerShell.cs index 92ce754c02cb..39ac2e180074 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementConfiguration.PowerShell.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementConfiguration.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.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class ManagementConfiguration 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.MonitoringSolutions.Models.Api20151101Preview.IManagementConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ManagementConfiguration(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.MonitoringSolutions.Models.Api20151101Preview.IManagementConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ManagementConfiguration(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api2 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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,49 +111,49 @@ internal ManagementConfiguration(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ManagementConfigurationPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ManagementConfigurationPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("ApplicationId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationInternal)this).ApplicationId = (string) content.GetValueForProperty("ApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationInternal)this).ApplicationId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationInternal)this).ApplicationId = (string) content.GetValueForProperty("ApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationInternal)this).ApplicationId, global::System.Convert.ToString); } if (content.Contains("ParentResourceType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationInternal)this).ParentResourceType = (string) content.GetValueForProperty("ParentResourceType",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationInternal)this).ParentResourceType, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationInternal)this).ParentResourceType = (string) content.GetValueForProperty("ParentResourceType",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationInternal)this).ParentResourceType, global::System.Convert.ToString); } if (content.Contains("Parameter")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationInternal)this).Parameter = (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IArmTemplateParameter[]) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationInternal)this).Parameter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ArmTemplateParameterTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationInternal)this).Parameter = (System.Collections.Generic.List) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationInternal)this).Parameter, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ArmTemplateParameterTypeConverter.ConvertFrom)); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationInternal)this).ProvisioningState, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Template")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationInternal)this).Template = (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IAny) content.GetValueForProperty("Template",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationInternal)this).Template, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.AnyTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationInternal)this).Template = (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IAny) content.GetValueForProperty("Template",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationInternal)this).Template, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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. @@ -162,43 +168,43 @@ internal ManagementConfiguration(global::System.Management.Automation.PSObject c // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ManagementConfigurationPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ManagementConfigurationPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("ApplicationId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationInternal)this).ApplicationId = (string) content.GetValueForProperty("ApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationInternal)this).ApplicationId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationInternal)this).ApplicationId = (string) content.GetValueForProperty("ApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationInternal)this).ApplicationId, global::System.Convert.ToString); } if (content.Contains("ParentResourceType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationInternal)this).ParentResourceType = (string) content.GetValueForProperty("ParentResourceType",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationInternal)this).ParentResourceType, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationInternal)this).ParentResourceType = (string) content.GetValueForProperty("ParentResourceType",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationInternal)this).ParentResourceType, global::System.Convert.ToString); } if (content.Contains("Parameter")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationInternal)this).Parameter = (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IArmTemplateParameter[]) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationInternal)this).Parameter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ArmTemplateParameterTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationInternal)this).Parameter = (System.Collections.Generic.List) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationInternal)this).Parameter, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ArmTemplateParameterTypeConverter.ConvertFrom)); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationInternal)this).ProvisioningState, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Template")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationInternal)this).Template = (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IAny) content.GetValueForProperty("Template",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationInternal)this).Template, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.AnyTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationInternal)this).Template = (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IAny) content.GetValueForProperty("Template",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationInternal)this).Template, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.AnyTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } @@ -207,6 +213,18 @@ internal ManagementConfiguration(global::System.Management.Automation.PSObject c /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 container for solution. [System.ComponentModel.TypeConverter(typeof(ManagementConfigurationTypeConverter))] diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementConfiguration.TypeConverter.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementConfiguration.TypeConverter.cs similarity index 97% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementConfiguration.TypeConverter.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementConfiguration.TypeConverter.cs index 2b5f58eaa73b..48e731100730 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementConfiguration.TypeConverter.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementConfiguration.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.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Models.Api20151101Preview.IManagementConfiguration ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfiguration ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfiguration).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfiguration).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementConfiguration.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementConfiguration.cs similarity index 68% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementConfiguration.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementConfiguration.cs index d1d92d69dfea..0dd45fd1b684 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementConfiguration.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementConfiguration.cs @@ -3,19 +3,19 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Extensions; /// The container for solution. public partial class ManagementConfiguration : - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfiguration, - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationInternal + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfiguration, + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationInternal { /// The applicationId of the appliance for this Management. [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Origin(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.PropertyOrigin.Inlined)] - public string ApplicationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationPropertiesInternal)Property).ApplicationId; set => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationPropertiesInternal)Property).ApplicationId = value ?? null; } + public string ApplicationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationPropertiesInternal)Property).ApplicationId; set => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationPropertiesInternal)Property).ApplicationId = value ?? null; } /// Backing field for property. private string _id; @@ -32,19 +32,19 @@ public partial class ManagementConfiguration : public string Location { get => this._location; set => this._location = value; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationInternal.Id { get => this._id; set { {_id = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationInternal.Id { get => this._id; set { {_id = value;} } } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationInternal.Name { get => this._name; set { {_name = value;} } } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationProperties Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ManagementConfigurationProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationProperties Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ManagementConfigurationProperties()); set { {_property = value;} } } /// Internal Acessors for ProvisioningState - string Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationPropertiesInternal)Property).ProvisioningState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationPropertiesInternal)Property).ProvisioningState = value; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationInternal.Type { get => this._type; set { {_type = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationInternal.Type { get => this._type; set { {_type = value;} } } /// Backing field for property. private string _name; @@ -55,28 +55,32 @@ public partial class ManagementConfiguration : /// Parameters to run the ARM template [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Origin(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IArmTemplateParameter[] Parameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationPropertiesInternal)Property).Parameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationPropertiesInternal)Property).Parameter = value ?? null /* arrayOf */; } + public System.Collections.Generic.List Parameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationPropertiesInternal)Property).Parameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationPropertiesInternal)Property).Parameter = value ?? null /* arrayOf */; } /// The type of the parent resource. [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Origin(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.PropertyOrigin.Inlined)] - public string ParentResourceType { get => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationPropertiesInternal)Property).ParentResourceType; set => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationPropertiesInternal)Property).ParentResourceType = value ?? null; } + public string ParentResourceType { get => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationPropertiesInternal)Property).ParentResourceType; set => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationPropertiesInternal)Property).ParentResourceType = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationProperties _property; /// /// Properties for ManagementConfiguration object supported by the OperationsManagement resource provider. /// [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Origin(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ManagementConfigurationProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ManagementConfigurationProperties()); set => this._property = value; } /// The provisioning state for the ManagementConfiguration. [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Origin(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.PropertyOrigin.Inlined)] - public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationPropertiesInternal)Property).ProvisioningState; } + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationPropertiesInternal)Property).ProvisioningState; } + + /// Gets the resource group name + [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Origin(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 Json object containing the ARM template to deploy [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Origin(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IAny Template { get => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationPropertiesInternal)Property).Template; set => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationPropertiesInternal)Property).Template = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IAny Template { get => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationPropertiesInternal)Property).Template; set => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationPropertiesInternal)Property).Template = value ?? null /* model class */; } /// Backing field for property. private string _type; @@ -99,6 +103,9 @@ public partial interface IManagementConfiguration : [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The applicationId of the appliance for this Management.", SerializedName = @"applicationId", PossibleTypes = new [] { typeof(string) })] @@ -107,6 +114,9 @@ public partial interface IManagementConfiguration : [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Resource ID.", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -115,6 +125,9 @@ public partial interface IManagementConfiguration : [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Resource location", SerializedName = @"location", PossibleTypes = new [] { typeof(string) })] @@ -123,6 +136,9 @@ public partial interface IManagementConfiguration : [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Resource name.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -131,14 +147,20 @@ public partial interface IManagementConfiguration : [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Parameters to run the ARM template", SerializedName = @"parameters", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IArmTemplateParameter) })] - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IArmTemplateParameter[] Parameter { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IArmTemplateParameter) })] + System.Collections.Generic.List Parameter { get; set; } /// The type of the parent resource. [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of the parent resource.", SerializedName = @"parentResourceType", PossibleTypes = new [] { typeof(string) })] @@ -147,6 +169,9 @@ public partial interface IManagementConfiguration : [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The provisioning state for the ManagementConfiguration.", SerializedName = @"provisioningState", PossibleTypes = new [] { typeof(string) })] @@ -155,6 +180,9 @@ public partial interface IManagementConfiguration : [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The Json object containing the ARM template to deploy", SerializedName = @"template", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IAny) })] @@ -163,6 +191,9 @@ public partial interface IManagementConfiguration : [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Resource type.", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -182,13 +213,13 @@ internal partial interface IManagementConfigurationInternal /// Resource name. string Name { get; set; } /// Parameters to run the ARM template - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IArmTemplateParameter[] Parameter { get; set; } + System.Collections.Generic.List Parameter { get; set; } /// The type of the parent resource. string ParentResourceType { get; set; } /// /// Properties for ManagementConfiguration object supported by the OperationsManagement resource provider. /// - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationProperties Property { get; set; } /// The provisioning state for the ManagementConfiguration. string ProvisioningState { get; set; } /// The Json object containing the ARM template to deploy diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementConfiguration.json.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementConfiguration.json.cs similarity index 93% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementConfiguration.json.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementConfiguration.json.cs index 5c5fffdfc778..d894c31fdc48 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementConfiguration.json.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementConfiguration.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.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ManagementConfiguration partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfiguration. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfiguration. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfiguration. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfiguration. /// - public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonObject json ? new ManagementConfiguration(json) : null; } @@ -77,11 +77,11 @@ internal ManagementConfiguration(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSo { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ManagementConfigurationProperties.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;} - {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)Location;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ManagementConfigurationProperties.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;} + {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)_location;} AfterFromJson(json); } @@ -105,15 +105,15 @@ public Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonN return container; } AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); } diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementConfigurationProperties.PowerShell.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementConfigurationProperties.PowerShell.cs similarity index 60% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementConfigurationProperties.PowerShell.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementConfigurationProperties.PowerShell.cs index 9baaded30076..90745f9973b8 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementConfigurationProperties.PowerShell.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementConfigurationProperties.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.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.PowerShell; @@ -57,29 +57,37 @@ public partial class ManagementConfigurationProperties 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.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ManagementConfigurationProperties(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.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ManagementConfigurationProperties(content); } @@ -91,10 +99,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api2 /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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. @@ -109,29 +117,29 @@ internal ManagementConfigurationProperties(global::System.Collections.IDictionar // actually deserialize if (content.Contains("ApplicationId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationPropertiesInternal)this).ApplicationId = (string) content.GetValueForProperty("ApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationPropertiesInternal)this).ApplicationId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationPropertiesInternal)this).ApplicationId = (string) content.GetValueForProperty("ApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationPropertiesInternal)this).ApplicationId, global::System.Convert.ToString); } if (content.Contains("ParentResourceType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationPropertiesInternal)this).ParentResourceType = (string) content.GetValueForProperty("ParentResourceType",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationPropertiesInternal)this).ParentResourceType, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationPropertiesInternal)this).ParentResourceType = (string) content.GetValueForProperty("ParentResourceType",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationPropertiesInternal)this).ParentResourceType, global::System.Convert.ToString); } if (content.Contains("Parameter")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationPropertiesInternal)this).Parameter = (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IArmTemplateParameter[]) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationPropertiesInternal)this).Parameter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ArmTemplateParameterTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationPropertiesInternal)this).Parameter = (System.Collections.Generic.List) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationPropertiesInternal)this).Parameter, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ArmTemplateParameterTypeConverter.ConvertFrom)); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Template")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationPropertiesInternal)this).Template = (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IAny) content.GetValueForProperty("Template",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationPropertiesInternal)this).Template, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.AnyTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationPropertiesInternal)this).Template = (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IAny) content.GetValueForProperty("Template",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationPropertiesInternal)this).Template, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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. @@ -146,23 +154,23 @@ internal ManagementConfigurationProperties(global::System.Management.Automation. // actually deserialize if (content.Contains("ApplicationId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationPropertiesInternal)this).ApplicationId = (string) content.GetValueForProperty("ApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationPropertiesInternal)this).ApplicationId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationPropertiesInternal)this).ApplicationId = (string) content.GetValueForProperty("ApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationPropertiesInternal)this).ApplicationId, global::System.Convert.ToString); } if (content.Contains("ParentResourceType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationPropertiesInternal)this).ParentResourceType = (string) content.GetValueForProperty("ParentResourceType",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationPropertiesInternal)this).ParentResourceType, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationPropertiesInternal)this).ParentResourceType = (string) content.GetValueForProperty("ParentResourceType",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationPropertiesInternal)this).ParentResourceType, global::System.Convert.ToString); } if (content.Contains("Parameter")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationPropertiesInternal)this).Parameter = (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IArmTemplateParameter[]) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationPropertiesInternal)this).Parameter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ArmTemplateParameterTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationPropertiesInternal)this).Parameter = (System.Collections.Generic.List) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationPropertiesInternal)this).Parameter, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ArmTemplateParameterTypeConverter.ConvertFrom)); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Template")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationPropertiesInternal)this).Template = (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IAny) content.GetValueForProperty("Template",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationPropertiesInternal)this).Template, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.AnyTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationPropertiesInternal)this).Template = (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IAny) content.GetValueForProperty("Template",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationPropertiesInternal)this).Template, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.AnyTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } @@ -171,6 +179,18 @@ internal ManagementConfigurationProperties(global::System.Management.Automation. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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(); + } } /// ManagementConfiguration properties supported by the OperationsManagement resource provider. [System.ComponentModel.TypeConverter(typeof(ManagementConfigurationPropertiesTypeConverter))] diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementConfigurationProperties.TypeConverter.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementConfigurationProperties.TypeConverter.cs similarity index 96% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementConfigurationProperties.TypeConverter.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementConfigurationProperties.TypeConverter.cs index 66f5965f0bb2..41277394788c 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementConfigurationProperties.TypeConverter.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementConfigurationProperties.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.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementConfigurationProperties.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementConfigurationProperties.cs similarity index 83% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementConfigurationProperties.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementConfigurationProperties.cs index 241baedcda5a..cc01657eff15 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementConfigurationProperties.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementConfigurationProperties.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Extensions; @@ -11,8 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151 /// ManagementConfiguration properties supported by the OperationsManagement resource provider. /// public partial class ManagementConfigurationProperties : - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationProperties, - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationProperties, + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationPropertiesInternal { /// Backing field for property. @@ -23,14 +23,14 @@ public partial class ManagementConfigurationProperties : public string ApplicationId { get => this._applicationId; set => this._applicationId = value; } /// Internal Acessors for ProvisioningState - string Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IArmTemplateParameter[] _parameter; + private System.Collections.Generic.List _parameter; /// Parameters to run the ARM template [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Origin(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IArmTemplateParameter[] Parameter { get => this._parameter; set => this._parameter = value; } + public System.Collections.Generic.List Parameter { get => this._parameter; set => this._parameter = value; } /// Backing field for property. private string _parentResourceType; @@ -67,6 +67,9 @@ public partial interface IManagementConfigurationProperties : [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The applicationId of the appliance for this Management.", SerializedName = @"applicationId", PossibleTypes = new [] { typeof(string) })] @@ -75,14 +78,20 @@ public partial interface IManagementConfigurationProperties : [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Parameters to run the ARM template", SerializedName = @"parameters", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IArmTemplateParameter) })] - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IArmTemplateParameter[] Parameter { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IArmTemplateParameter) })] + System.Collections.Generic.List Parameter { get; set; } /// The type of the parent resource. [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of the parent resource.", SerializedName = @"parentResourceType", PossibleTypes = new [] { typeof(string) })] @@ -91,6 +100,9 @@ public partial interface IManagementConfigurationProperties : [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The provisioning state for the ManagementConfiguration.", SerializedName = @"provisioningState", PossibleTypes = new [] { typeof(string) })] @@ -99,6 +111,9 @@ public partial interface IManagementConfigurationProperties : [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The Json object containing the ARM template to deploy", SerializedName = @"template", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IAny) })] @@ -112,7 +127,7 @@ internal partial interface IManagementConfigurationPropertiesInternal /// The applicationId of the appliance for this Management. string ApplicationId { get; set; } /// Parameters to run the ARM template - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IArmTemplateParameter[] Parameter { get; set; } + System.Collections.Generic.List Parameter { get; set; } /// The type of the parent resource. string ParentResourceType { get; set; } /// The provisioning state for the ManagementConfiguration. diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementConfigurationProperties.json.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementConfigurationProperties.json.cs similarity index 90% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementConfigurationProperties.json.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementConfigurationProperties.json.cs index 0648457a6f85..0c785f2186f0 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementConfigurationProperties.json.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementConfigurationProperties.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.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class ManagementConfigurationProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonObject json ? new ManagementConfigurationProperties(json) : null; } @@ -79,11 +79,11 @@ internal ManagementConfigurationProperties(Microsoft.Azure.PowerShell.Cmdlets.Mo { return; } - {_applicationId = If( json?.PropertyT("applicationId"), out var __jsonApplicationId) ? (string)__jsonApplicationId : (string)ApplicationId;} - {_parentResourceType = If( json?.PropertyT("parentResourceType"), out var __jsonParentResourceType) ? (string)__jsonParentResourceType : (string)ParentResourceType;} - {_parameter = If( json?.PropertyT("parameters"), out var __jsonParameters) ? If( __jsonParameters as Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Models.Api20151101Preview.IArmTemplateParameter) (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ArmTemplateParameter.FromJson(__u) )) ))() : null : Parameter;} - {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} - {_template = If( json?.PropertyT("template"), out var __jsonTemplate) ? Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Any.FromJson(__jsonTemplate) : Template;} + {_applicationId = If( json?.PropertyT("applicationId"), out var __jsonApplicationId) ? (string)__jsonApplicationId : (string)_applicationId;} + {_parentResourceType = If( json?.PropertyT("parentResourceType"), out var __jsonParentResourceType) ? (string)__jsonParentResourceType : (string)_parentResourceType;} + {_parameter = If( json?.PropertyT("parameters"), out var __jsonParameters) ? If( __jsonParameters as Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Models.IArmTemplateParameter) (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ArmTemplateParameter.FromJson(__u) )) ))() : null : _parameter;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} + {_template = If( json?.PropertyT("template"), out var __jsonTemplate) ? Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Any.FromJson(__jsonTemplate) : _template;} AfterFromJson(json); } @@ -117,7 +117,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonN } container.Add("parameters",__w); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); } diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementConfigurationPropertiesList.PowerShell.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementConfigurationPropertiesList.PowerShell.cs similarity index 71% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementConfigurationPropertiesList.PowerShell.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementConfigurationPropertiesList.PowerShell.cs index b50fbbeb8ffb..59f048928f46 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementConfigurationPropertiesList.PowerShell.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementConfigurationPropertiesList.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.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class ManagementConfigurationPropertiesList 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.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationPropertiesList DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationPropertiesList DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ManagementConfigurationPropertiesList(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.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationPropertiesList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationPropertiesList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ManagementConfigurationPropertiesList(content); } @@ -90,10 +98,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api2 /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationPropertiesList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationPropertiesList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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,13 +116,13 @@ internal ManagementConfigurationPropertiesList(global::System.Collections.IDicti // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationPropertiesListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfiguration[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationPropertiesListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ManagementConfigurationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationPropertiesListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationPropertiesListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ManagementConfigurationTypeConverter.ConvertFrom)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -129,7 +137,7 @@ internal ManagementConfigurationPropertiesList(global::System.Management.Automat // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationPropertiesListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfiguration[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationPropertiesListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ManagementConfigurationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationPropertiesListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationPropertiesListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ManagementConfigurationTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } @@ -138,6 +146,18 @@ internal ManagementConfigurationPropertiesList(global::System.Management.Automat /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 list of ManagementConfiguration response [System.ComponentModel.TypeConverter(typeof(ManagementConfigurationPropertiesListTypeConverter))] diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementConfigurationPropertiesList.TypeConverter.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementConfigurationPropertiesList.TypeConverter.cs similarity index 96% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementConfigurationPropertiesList.TypeConverter.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementConfigurationPropertiesList.TypeConverter.cs index c134c0d5fc0b..4fdf7217aedd 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementConfigurationPropertiesList.TypeConverter.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementConfigurationPropertiesList.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.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationPropertiesList ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationPropertiesList ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationPropertiesList).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationPropertiesList).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementConfigurationPropertiesList.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementConfigurationPropertiesList.cs similarity index 71% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementConfigurationPropertiesList.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementConfigurationPropertiesList.cs index 1f305efbe24f..80d2114ecae2 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementConfigurationPropertiesList.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementConfigurationPropertiesList.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.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Extensions; /// the list of ManagementConfiguration response public partial class ManagementConfigurationPropertiesList : - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationPropertiesList, - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationPropertiesListInternal + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationPropertiesList, + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationPropertiesListInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfiguration[] _value; + private System.Collections.Generic.List _value; /// List of Management Configuration properties within the subscription. [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Origin(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfiguration[] 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 ManagementConfigurationPropertiesList() @@ -34,10 +34,13 @@ public partial interface IManagementConfigurationPropertiesList : [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"List of Management Configuration properties within the subscription.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfiguration) })] - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfiguration[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfiguration) })] + System.Collections.Generic.List Value { get; set; } } /// the list of ManagementConfiguration response @@ -45,7 +48,7 @@ internal partial interface IManagementConfigurationPropertiesListInternal { /// List of Management Configuration properties within the subscription. - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfiguration[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementConfigurationPropertiesList.json.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementConfigurationPropertiesList.json.cs similarity index 89% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementConfigurationPropertiesList.json.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementConfigurationPropertiesList.json.cs index da60c5840ba0..da5b375a1021 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/ManagementConfigurationPropertiesList.json.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/ManagementConfigurationPropertiesList.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.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ManagementConfigurationPropertiesList partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationPropertiesList. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationPropertiesList. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationPropertiesList. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationPropertiesList. /// - public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfigurationPropertiesList FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfigurationPropertiesList FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonObject json ? new ManagementConfigurationPropertiesList(json) : null; } @@ -77,7 +77,7 @@ internal ManagementConfigurationPropertiesList(Microsoft.Azure.PowerShell.Cmdlet { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Models.Api20151101Preview.IManagementConfiguration) (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ManagementConfiguration.FromJson(__u) )) ))() : null : Value;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Models.IManagementConfiguration) (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ManagementConfiguration.FromJson(__u) )) ))() : null : _value;} AfterFromJson(json); } diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/MonitoringSolutionsIdentity.PowerShell.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/MonitoringSolutionsIdentity.PowerShell.cs index e15e90fd7e27..3dadb305cc40 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/MonitoringSolutionsIdentity.PowerShell.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/MonitoringSolutionsIdentity.PowerShell.cs @@ -53,6 +53,14 @@ public partial class MonitoringSolutionsIdentity 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 . @@ -198,6 +206,18 @@ internal MonitoringSolutionsIdentity(global::System.Management.Automation.PSObje /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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(MonitoringSolutionsIdentityTypeConverter))] public partial interface IMonitoringSolutionsIdentity diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/MonitoringSolutionsIdentity.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/MonitoringSolutionsIdentity.cs index 271853f6c370..e317dad1aef4 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/MonitoringSolutionsIdentity.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/MonitoringSolutionsIdentity.cs @@ -91,6 +91,9 @@ public partial interface IMonitoringSolutionsIdentity : [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Resource identity path", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -99,6 +102,9 @@ public partial interface IMonitoringSolutionsIdentity : [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"User ManagementAssociation Name.", SerializedName = @"managementAssociationName", PossibleTypes = new [] { typeof(string) })] @@ -107,6 +113,9 @@ public partial interface IMonitoringSolutionsIdentity : [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"User Management Configuration Name.", SerializedName = @"managementConfigurationName", PossibleTypes = new [] { typeof(string) })] @@ -115,6 +124,9 @@ public partial interface IMonitoringSolutionsIdentity : [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Provider name for the parent resource.", SerializedName = @"providerName", PossibleTypes = new [] { typeof(string) })] @@ -123,6 +135,9 @@ public partial interface IMonitoringSolutionsIdentity : [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the resource group to get. The name is case insensitive.", SerializedName = @"resourceGroupName", PossibleTypes = new [] { typeof(string) })] @@ -131,6 +146,9 @@ public partial interface IMonitoringSolutionsIdentity : [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Parent resource name.", SerializedName = @"resourceName", PossibleTypes = new [] { typeof(string) })] @@ -139,6 +157,9 @@ public partial interface IMonitoringSolutionsIdentity : [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Resource type for the parent resource", SerializedName = @"resourceType", PossibleTypes = new [] { typeof(string) })] @@ -147,6 +168,9 @@ public partial interface IMonitoringSolutionsIdentity : [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"User Solution Name.", SerializedName = @"solutionName", PossibleTypes = new [] { typeof(string) })] @@ -158,6 +182,9 @@ public partial interface IMonitoringSolutionsIdentity : [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", SerializedName = @"subscriptionId", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/MonitoringSolutionsIdentity.json.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/MonitoringSolutionsIdentity.json.cs index c0e9d0d144c6..3f1ae50e42f6 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/MonitoringSolutionsIdentity.json.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/MonitoringSolutionsIdentity.json.cs @@ -76,15 +76,15 @@ internal MonitoringSolutionsIdentity(Microsoft.Azure.PowerShell.Cmdlets.Monitori { 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;} - {_solutionName = If( json?.PropertyT("solutionName"), out var __jsonSolutionName) ? (string)__jsonSolutionName : (string)SolutionName;} - {_providerName = If( json?.PropertyT("providerName"), out var __jsonProviderName) ? (string)__jsonProviderName : (string)ProviderName;} - {_resourceType = If( json?.PropertyT("resourceType"), out var __jsonResourceType) ? (string)__jsonResourceType : (string)ResourceType;} - {_resourceName = If( json?.PropertyT("resourceName"), out var __jsonResourceName) ? (string)__jsonResourceName : (string)ResourceName;} - {_managementAssociationName = If( json?.PropertyT("managementAssociationName"), out var __jsonManagementAssociationName) ? (string)__jsonManagementAssociationName : (string)ManagementAssociationName;} - {_managementConfigurationName = If( json?.PropertyT("managementConfigurationName"), out var __jsonManagementConfigurationName) ? (string)__jsonManagementConfigurationName : (string)ManagementConfigurationName;} - {_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;} + {_solutionName = If( json?.PropertyT("solutionName"), out var __jsonSolutionName) ? (string)__jsonSolutionName : (string)_solutionName;} + {_providerName = If( json?.PropertyT("providerName"), out var __jsonProviderName) ? (string)__jsonProviderName : (string)_providerName;} + {_resourceType = If( json?.PropertyT("resourceType"), out var __jsonResourceType) ? (string)__jsonResourceType : (string)_resourceType;} + {_resourceName = If( json?.PropertyT("resourceName"), out var __jsonResourceName) ? (string)__jsonResourceName : (string)_resourceName;} + {_managementAssociationName = If( json?.PropertyT("managementAssociationName"), out var __jsonManagementAssociationName) ? (string)__jsonManagementAssociationName : (string)_managementAssociationName;} + {_managementConfigurationName = If( json?.PropertyT("managementConfigurationName"), out var __jsonManagementConfigurationName) ? (string)__jsonManagementConfigurationName : (string)_managementConfigurationName;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} AfterFromJson(json); } diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/Operation.PowerShell.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Operation.PowerShell.cs similarity index 65% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/Operation.PowerShell.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Operation.PowerShell.cs index 7e3666dd4511..2f0579a59b08 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/Operation.PowerShell.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Operation.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class Operation 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.MonitoringSolutions.Models.Api20151101Preview.IOperation DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperation DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new Operation(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new Operation(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api2 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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,29 +111,29 @@ internal Operation(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Display")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.OperationDisplayTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.OperationDisplayTypeConverter.ConvertFrom); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("DisplayProvider")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationInternal)this).DisplayProvider, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationInternal)this).DisplayProvider, global::System.Convert.ToString); } if (content.Contains("DisplayResource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationInternal)this).DisplayResource, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationInternal)this).DisplayResource, global::System.Convert.ToString); } if (content.Contains("DisplayOperation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationInternal)this).DisplayOperation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationInternal)this).DisplayOperation, 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,23 +148,23 @@ internal Operation(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Display")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.OperationDisplayTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.OperationDisplayTypeConverter.ConvertFrom); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("DisplayProvider")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationInternal)this).DisplayProvider, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationInternal)this).DisplayProvider, global::System.Convert.ToString); } if (content.Contains("DisplayResource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationInternal)this).DisplayResource, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationInternal)this).DisplayResource, global::System.Convert.ToString); } if (content.Contains("DisplayOperation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationInternal)this).DisplayOperation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationInternal)this).DisplayOperation, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -167,6 +173,18 @@ internal Operation(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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(); + } } /// Supported operation of OperationsManagement resource provider. [System.ComponentModel.TypeConverter(typeof(OperationTypeConverter))] diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/Operation.TypeConverter.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Operation.TypeConverter.cs similarity index 97% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/Operation.TypeConverter.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Operation.TypeConverter.cs index 5fde330af3e5..bd90f1c44dcf 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/Operation.TypeConverter.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Operation.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Models.Api20151101Preview.IOperation ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperation ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperation).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperation).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/Operation.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Operation.cs similarity index 77% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/Operation.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Operation.cs index 9badc50127bc..5793b0743e33 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/Operation.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Operation.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.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Extensions; /// Supported operation of OperationsManagement resource provider. public partial class Operation : - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperation, - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationInternal + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperation, + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationDisplay _display; + private Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationDisplay _display; /// Display metadata associated with the operation. [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Origin(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationDisplay Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.OperationDisplay()); set => this._display = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationDisplay Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.OperationDisplay()); set => this._display = value; } /// Type of operation: get, read, delete, etc. [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Origin(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.PropertyOrigin.Inlined)] - public string DisplayOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationDisplayInternal)Display).Operation; set => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationDisplayInternal)Display).Operation = value ?? null; } + public string DisplayOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationDisplayInternal)Display).Operation; set => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationDisplayInternal)Display).Operation = value ?? null; } /// Service provider: Microsoft OperationsManagement. [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Origin(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.PropertyOrigin.Inlined)] - public string DisplayProvider { get => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationDisplayInternal)Display).Provider; set => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationDisplayInternal)Display).Provider = value ?? null; } + public string DisplayProvider { get => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationDisplayInternal)Display).Provider; set => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationDisplayInternal)Display).Provider = value ?? null; } /// Resource on which the operation is performed etc. [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Origin(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.PropertyOrigin.Inlined)] - public string DisplayResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationDisplayInternal)Display).Resource; set => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationDisplayInternal)Display).Resource = value ?? null; } + public string DisplayResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationDisplayInternal)Display).Resource; set => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationDisplayInternal)Display).Resource = value ?? null; } /// Internal Acessors for Display - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationDisplay Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationInternal.Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.OperationDisplay()); set { {_display = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationDisplay Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationInternal.Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.OperationDisplay()); set { {_display = value;} } } /// Backing field for property. private string _name; @@ -56,6 +56,9 @@ public partial interface IOperation : [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of operation: get, read, delete, etc.", SerializedName = @"operation", PossibleTypes = new [] { typeof(string) })] @@ -64,6 +67,9 @@ public partial interface IOperation : [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Service provider: Microsoft OperationsManagement.", SerializedName = @"provider", PossibleTypes = new [] { typeof(string) })] @@ -72,6 +78,9 @@ public partial interface IOperation : [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Resource on which the operation is performed etc.", SerializedName = @"resource", PossibleTypes = new [] { typeof(string) })] @@ -80,6 +89,9 @@ public partial interface IOperation : [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Operation name: {provider}/{resource}/{operation}", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -91,7 +103,7 @@ internal partial interface IOperationInternal { /// Display metadata associated with the operation. - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationDisplay Display { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationDisplay Display { get; set; } /// Type of operation: get, read, delete, etc. string DisplayOperation { get; set; } /// Service provider: Microsoft OperationsManagement. diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/Operation.json.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Operation.json.cs similarity index 94% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/Operation.json.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Operation.json.cs index 30c751d18eec..7bd0e3398a1a 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/Operation.json.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Operation.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class Operation partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperation. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperation. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperation. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperation. /// - public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperation FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperation FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonObject json ? new Operation(json) : null; } @@ -77,8 +77,8 @@ internal Operation(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtim { return; } - {_display = If( json?.PropertyT("display"), out var __jsonDisplay) ? Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.OperationDisplay.FromJson(__jsonDisplay) : Display;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_display = If( json?.PropertyT("display"), out var __jsonDisplay) ? Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.OperationDisplay.FromJson(__jsonDisplay) : _display;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} AfterFromJson(json); } diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/OperationDisplay.PowerShell.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/OperationDisplay.PowerShell.cs similarity index 71% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/OperationDisplay.PowerShell.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/OperationDisplay.PowerShell.cs index 478821929628..9d3152cb2ff9 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/OperationDisplay.PowerShell.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/OperationDisplay.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class OperationDisplay 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.MonitoringSolutions.Models.Api20151101Preview.IOperationDisplay DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationDisplay DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new OperationDisplay(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationDisplay DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationDisplay DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new OperationDisplay(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api2 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationDisplay FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationDisplay FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 OperationDisplay(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Provider")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationDisplayInternal)this).Provider, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationDisplayInternal)this).Provider, global::System.Convert.ToString); } if (content.Contains("Resource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationDisplayInternal)this).Resource, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationDisplayInternal)this).Resource, global::System.Convert.ToString); } if (content.Contains("Operation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationDisplayInternal)this).Operation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationDisplayInternal)this).Operation, 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 OperationDisplay(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Provider")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationDisplayInternal)this).Provider, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationDisplayInternal)this).Provider, global::System.Convert.ToString); } if (content.Contains("Resource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationDisplayInternal)this).Resource, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationDisplayInternal)this).Resource, global::System.Convert.ToString); } if (content.Contains("Operation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationDisplayInternal)this).Operation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationDisplayInternal)this).Operation, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -151,6 +157,18 @@ internal OperationDisplay(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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(); + } } /// Display metadata associated with the operation. [System.ComponentModel.TypeConverter(typeof(OperationDisplayTypeConverter))] diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/OperationDisplay.TypeConverter.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/OperationDisplay.TypeConverter.cs similarity index 97% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/OperationDisplay.TypeConverter.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/OperationDisplay.TypeConverter.cs index 5d95a38b0fc8..92ecbb1159c8 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/OperationDisplay.TypeConverter.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/OperationDisplay.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Models.Api20151101Preview.IOperationDisplay ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationDisplay ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationDisplay).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationDisplay).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/OperationDisplay.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/OperationDisplay.cs similarity index 93% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/OperationDisplay.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/OperationDisplay.cs index 92956ebe9296..86e66dac6deb 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/OperationDisplay.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/OperationDisplay.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Extensions; /// Display metadata associated with the operation. public partial class OperationDisplay : - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationDisplay, - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationDisplayInternal + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationDisplay, + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationDisplayInternal { /// Backing field for property. @@ -48,6 +48,9 @@ public partial interface IOperationDisplay : [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of operation: get, read, delete, etc.", SerializedName = @"operation", PossibleTypes = new [] { typeof(string) })] @@ -56,6 +59,9 @@ public partial interface IOperationDisplay : [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Service provider: Microsoft OperationsManagement.", SerializedName = @"provider", PossibleTypes = new [] { typeof(string) })] @@ -64,6 +70,9 @@ public partial interface IOperationDisplay : [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Resource on which the operation is performed etc.", SerializedName = @"resource", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/OperationDisplay.json.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/OperationDisplay.json.cs similarity index 95% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/OperationDisplay.json.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/OperationDisplay.json.cs index 03467bded7f2..165493449caa 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/OperationDisplay.json.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/OperationDisplay.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class OperationDisplay partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationDisplay. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationDisplay. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationDisplay. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationDisplay. /// - public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationDisplay FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationDisplay FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonObject json ? new OperationDisplay(json) : null; } @@ -77,9 +77,9 @@ internal OperationDisplay(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions { return; } - {_provider = If( json?.PropertyT("provider"), out var __jsonProvider) ? (string)__jsonProvider : (string)Provider;} - {_resource = If( json?.PropertyT("resource"), out var __jsonResource) ? (string)__jsonResource : (string)Resource;} - {_operation = If( json?.PropertyT("operation"), out var __jsonOperation) ? (string)__jsonOperation : (string)Operation;} + {_provider = If( json?.PropertyT("provider"), out var __jsonProvider) ? (string)__jsonProvider : (string)_provider;} + {_resource = If( json?.PropertyT("resource"), out var __jsonResource) ? (string)__jsonResource : (string)_resource;} + {_operation = If( json?.PropertyT("operation"), out var __jsonOperation) ? (string)__jsonOperation : (string)_operation;} AfterFromJson(json); } diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/OperationListResult.PowerShell.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/OperationListResult.PowerShell.cs similarity index 72% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/OperationListResult.PowerShell.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/OperationListResult.PowerShell.cs index 72c6ac7469ba..ea12cea3f463 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/OperationListResult.PowerShell.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/OperationListResult.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class OperationListResult 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.MonitoringSolutions.Models.Api20151101Preview.IOperationListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new OperationListResult(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new OperationListResult(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api2 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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,13 +111,13 @@ internal OperationListResult(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperation[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.OperationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.OperationTypeConverter.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. @@ -126,7 +132,7 @@ internal OperationListResult(global::System.Management.Automation.PSObject conte // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperation[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.OperationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.OperationTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } @@ -135,6 +141,18 @@ internal OperationListResult(global::System.Management.Automation.PSObject conte /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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(); + } } /// Result of the request to list solution operations. [System.ComponentModel.TypeConverter(typeof(OperationListResultTypeConverter))] diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/OperationListResult.TypeConverter.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/OperationListResult.TypeConverter.cs similarity index 97% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/OperationListResult.TypeConverter.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/OperationListResult.TypeConverter.cs index 078438abacd5..1c55e00dbc7f 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/OperationListResult.TypeConverter.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/OperationListResult.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Models.Api20151101Preview.IOperationListResult ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationListResult ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationListResult).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationListResult).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/OperationListResult.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/OperationListResult.cs similarity index 74% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/OperationListResult.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/OperationListResult.cs index 2732a9dc3810..f1a05971dd8e 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/OperationListResult.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/OperationListResult.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.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Extensions; /// Result of the request to list solution operations. public partial class OperationListResult : - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationListResult, - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationListResultInternal + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationListResult, + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationListResultInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperation[] _value; + private System.Collections.Generic.List _value; /// /// List of solution operations supported by the OperationsManagement resource provider. /// [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Origin(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperation[] Value { get => this._value; set => this._value = value; } + public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } /// Creates an new instance. public OperationListResult() @@ -38,10 +38,13 @@ public partial interface IOperationListResult : [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"List of solution operations supported by the OperationsManagement resource provider.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperation) })] - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperation[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperation) })] + System.Collections.Generic.List Value { get; set; } } /// Result of the request to list solution operations. @@ -51,7 +54,7 @@ internal partial interface IOperationListResultInternal /// /// List of solution operations supported by the OperationsManagement resource provider. /// - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperation[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/OperationListResult.json.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/OperationListResult.json.cs similarity index 90% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/OperationListResult.json.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/OperationListResult.json.cs index d61a598ea27e..862d42245326 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/OperationListResult.json.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/OperationListResult.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class OperationListResult partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationListResult. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationListResult. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationListResult. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationListResult. /// - public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonObject json ? new OperationListResult(json) : null; } @@ -77,7 +77,7 @@ internal OperationListResult(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSoluti { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Models.Api20151101Preview.IOperation) (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.Operation.FromJson(__u) )) ))() : null : Value;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Models.IOperation) (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Operation.FromJson(__u) )) ))() : null : _value;} AfterFromJson(json); } diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/Solution.PowerShell.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Solution.PowerShell.cs similarity index 50% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/Solution.PowerShell.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Solution.PowerShell.cs index 16372b2c8d34..6440429fe5cc 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/Solution.PowerShell.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Solution.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.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class Solution 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.MonitoringSolutions.Models.Api20151101Preview.ISolution DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolution DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new Solution(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.MonitoringSolutions.Models.Api20151101Preview.ISolution DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolution DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new Solution(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api2 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolution FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolution FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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,69 +111,69 @@ internal Solution(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Plan")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal)this).Plan = (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPlan) content.GetValueForProperty("Plan",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal)this).Plan, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.SolutionPlanTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal)this).Plan = (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPlan) content.GetValueForProperty("Plan",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal)this).Plan, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.SolutionPlanTypeConverter.ConvertFrom); } if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.SolutionPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.SolutionPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.SolutionTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.SolutionTagsTypeConverter.ConvertFrom); } if (content.Contains("PlanName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal)this).PlanName = (string) content.GetValueForProperty("PlanName",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal)this).PlanName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal)this).PlanName = (string) content.GetValueForProperty("PlanName",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal)this).PlanName, global::System.Convert.ToString); } if (content.Contains("PlanPublisher")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal)this).PlanPublisher = (string) content.GetValueForProperty("PlanPublisher",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal)this).PlanPublisher, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal)this).PlanPublisher = (string) content.GetValueForProperty("PlanPublisher",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal)this).PlanPublisher, global::System.Convert.ToString); } if (content.Contains("PlanPromotionCode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal)this).PlanPromotionCode = (string) content.GetValueForProperty("PlanPromotionCode",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal)this).PlanPromotionCode, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal)this).PlanPromotionCode = (string) content.GetValueForProperty("PlanPromotionCode",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal)this).PlanPromotionCode, global::System.Convert.ToString); } if (content.Contains("PlanProduct")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal)this).PlanProduct = (string) content.GetValueForProperty("PlanProduct",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal)this).PlanProduct, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal)this).PlanProduct = (string) content.GetValueForProperty("PlanProduct",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal)this).PlanProduct, global::System.Convert.ToString); } if (content.Contains("WorkspaceResourceId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal)this).WorkspaceResourceId = (string) content.GetValueForProperty("WorkspaceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal)this).WorkspaceResourceId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal)this).WorkspaceResourceId = (string) content.GetValueForProperty("WorkspaceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal)this).WorkspaceResourceId, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal)this).ProvisioningState, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("ContainedResource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal)this).ContainedResource = (string[]) content.GetValueForProperty("ContainedResource",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal)this).ContainedResource, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal)this).ContainedResource = (System.Collections.Generic.List) content.GetValueForProperty("ContainedResource",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal)this).ContainedResource, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("ReferencedResource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal)this).ReferencedResource = (string[]) content.GetValueForProperty("ReferencedResource",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal)this).ReferencedResource, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal)this).ReferencedResource = (System.Collections.Generic.List) content.GetValueForProperty("ReferencedResource",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal)this).ReferencedResource, __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. @@ -182,63 +188,63 @@ internal Solution(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Plan")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal)this).Plan = (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPlan) content.GetValueForProperty("Plan",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal)this).Plan, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.SolutionPlanTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal)this).Plan = (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPlan) content.GetValueForProperty("Plan",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal)this).Plan, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.SolutionPlanTypeConverter.ConvertFrom); } if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.SolutionPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.SolutionPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.SolutionTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.SolutionTagsTypeConverter.ConvertFrom); } if (content.Contains("PlanName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal)this).PlanName = (string) content.GetValueForProperty("PlanName",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal)this).PlanName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal)this).PlanName = (string) content.GetValueForProperty("PlanName",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal)this).PlanName, global::System.Convert.ToString); } if (content.Contains("PlanPublisher")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal)this).PlanPublisher = (string) content.GetValueForProperty("PlanPublisher",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal)this).PlanPublisher, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal)this).PlanPublisher = (string) content.GetValueForProperty("PlanPublisher",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal)this).PlanPublisher, global::System.Convert.ToString); } if (content.Contains("PlanPromotionCode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal)this).PlanPromotionCode = (string) content.GetValueForProperty("PlanPromotionCode",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal)this).PlanPromotionCode, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal)this).PlanPromotionCode = (string) content.GetValueForProperty("PlanPromotionCode",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal)this).PlanPromotionCode, global::System.Convert.ToString); } if (content.Contains("PlanProduct")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal)this).PlanProduct = (string) content.GetValueForProperty("PlanProduct",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal)this).PlanProduct, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal)this).PlanProduct = (string) content.GetValueForProperty("PlanProduct",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal)this).PlanProduct, global::System.Convert.ToString); } if (content.Contains("WorkspaceResourceId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal)this).WorkspaceResourceId = (string) content.GetValueForProperty("WorkspaceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal)this).WorkspaceResourceId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal)this).WorkspaceResourceId = (string) content.GetValueForProperty("WorkspaceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal)this).WorkspaceResourceId, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal)this).ProvisioningState, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("ContainedResource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal)this).ContainedResource = (string[]) content.GetValueForProperty("ContainedResource",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal)this).ContainedResource, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal)this).ContainedResource = (System.Collections.Generic.List) content.GetValueForProperty("ContainedResource",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal)this).ContainedResource, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("ReferencedResource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal)this).ReferencedResource = (string[]) content.GetValueForProperty("ReferencedResource",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal)this).ReferencedResource, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal)this).ReferencedResource = (System.Collections.Generic.List) content.GetValueForProperty("ReferencedResource",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal)this).ReferencedResource, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializePSObject(content); } @@ -247,6 +253,18 @@ internal Solution(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 container for solution. [System.ComponentModel.TypeConverter(typeof(SolutionTypeConverter))] diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/Solution.TypeConverter.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Solution.TypeConverter.cs similarity index 97% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/Solution.TypeConverter.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Solution.TypeConverter.cs index 461abb05ecf7..e6a825931be8 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/Solution.TypeConverter.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Solution.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.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Models.Api20151101Preview.ISolution ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolution ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolution).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolution).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/Solution.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Solution.cs similarity index 74% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/Solution.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Solution.cs index c51c56ddab9e..2c244a209cdc 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/Solution.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Solution.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.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Extensions; /// The container for solution. public partial class Solution : - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolution, - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolution, + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal { /// @@ -19,7 +19,7 @@ public partial class Solution : /// [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Origin(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.DoNotFormat] - public string[] ContainedResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPropertiesInternal)Property).ContainedResource; set => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPropertiesInternal)Property).ContainedResource = value ?? null /* arrayOf */; } + public System.Collections.Generic.List ContainedResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPropertiesInternal)Property).ContainedResource; set => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPropertiesInternal)Property).ContainedResource = value ?? null /* arrayOf */; } /// Backing field for property. private string _id; @@ -38,22 +38,22 @@ public partial class Solution : public string Location { get => this._location; set => this._location = value; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal.Id { get => this._id; set { {_id = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal.Id { get => this._id; set { {_id = value;} } } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal.Name { get => this._name; set { {_name = value;} } } /// Internal Acessors for Plan - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPlan Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal.Plan { get => (this._plan = this._plan ?? new Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.SolutionPlan()); set { {_plan = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPlan Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal.Plan { get => (this._plan = this._plan ?? new Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.SolutionPlan()); set { {_plan = value;} } } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionProperties Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.SolutionProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionProperties Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.SolutionProperties()); set { {_property = value;} } } /// Internal Acessors for ProvisioningState - string Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPropertiesInternal)Property).ProvisioningState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPropertiesInternal)Property).ProvisioningState = value; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionInternal.Type { get => this._type; set { {_type = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionInternal.Type { get => this._type; set { {_type = value;} } } /// Backing field for property. private string _name; @@ -64,14 +64,14 @@ public partial class Solution : public string Name { get => this._name; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPlan _plan; + private Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPlan _plan; /// /// Plan for solution object supported by the OperationsManagement resource provider. /// [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Origin(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.DoNotFormat] - internal Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPlan Plan { get => (this._plan = this._plan ?? new Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.SolutionPlan()); set => this._plan = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPlan Plan { get => (this._plan = this._plan ?? new Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.SolutionPlan()); set => this._plan = value; } /// /// name of the solution to be created. For Microsoft published solution it should be in the format of solutionType(workspaceName). @@ -79,7 +79,7 @@ public partial class Solution : /// [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Origin(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.DoNotFormat] - public string PlanName { get => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPlanInternal)Plan).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPlanInternal)Plan).Name = value ?? null; } + public string PlanName { get => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPlanInternal)Plan).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPlanInternal)Plan).Name = value ?? null; } /// /// name of the solution to enabled/add. For Microsoft published gallery solution it should be in the format of OMSGallery/. @@ -87,47 +87,52 @@ public partial class Solution : /// [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Origin(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.DoNotFormat] - public string PlanProduct { get => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPlanInternal)Plan).Product; set => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPlanInternal)Plan).Product = value ?? null; } + public string PlanProduct { get => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPlanInternal)Plan).Product; set => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPlanInternal)Plan).Product = value ?? null; } /// promotionCode, Not really used now, can you left as empty [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Origin(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.DoNotFormat] - public string PlanPromotionCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPlanInternal)Plan).PromotionCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPlanInternal)Plan).PromotionCode = value ?? null; } + public string PlanPromotionCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPlanInternal)Plan).PromotionCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPlanInternal)Plan).PromotionCode = value ?? null; } /// Publisher name. For gallery solution, it is Microsoft. [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Origin(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.DoNotFormat] - public string PlanPublisher { get => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPlanInternal)Plan).Publisher; set => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPlanInternal)Plan).Publisher = value ?? null; } + public string PlanPublisher { get => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPlanInternal)Plan).Publisher; set => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPlanInternal)Plan).Publisher = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionProperties _property; /// /// Properties for solution object supported by the OperationsManagement resource provider. /// [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Origin(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.DoNotFormat] - internal Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.SolutionProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.SolutionProperties()); set => this._property = value; } /// The provisioning state for the solution. [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Origin(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.DoNotFormat] - public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPropertiesInternal)Property).ProvisioningState; } + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPropertiesInternal)Property).ProvisioningState; } /// /// The resources that will be referenced from this solution. Deleting any of those solution out of band will break the solution. /// [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Origin(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.DoNotFormat] - public string[] ReferencedResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPropertiesInternal)Property).ReferencedResource; set => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPropertiesInternal)Property).ReferencedResource = value ?? null /* arrayOf */; } + public System.Collections.Generic.List ReferencedResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPropertiesInternal)Property).ReferencedResource; set => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPropertiesInternal)Property).ReferencedResource = value ?? null /* arrayOf */; } + + /// Gets the resource group name + [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Origin(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.PropertyOrigin.Owned)] + [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.DoNotFormat] + 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.MonitoringSolutions.Models.Api20151101Preview.ISolutionTags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionTags _tag; /// Resource tags [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Origin(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.SolutionTags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.SolutionTags()); set => this._tag = value; } /// Backing field for property. private string _type; @@ -142,7 +147,7 @@ public partial class Solution : /// [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Origin(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.DoNotFormat] - public string WorkspaceResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPropertiesInternal)Property).WorkspaceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPropertiesInternal)Property).WorkspaceResourceId = value ?? null; } + public string WorkspaceResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPropertiesInternal)Property).WorkspaceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPropertiesInternal)Property).WorkspaceResourceId = value ?? null; } /// Creates an new instance. public Solution() @@ -161,14 +166,20 @@ public partial interface ISolution : [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The azure resources that will be contained within the solutions. They will be locked and gets deleted automatically when the solution is deleted.", SerializedName = @"containedResources", PossibleTypes = new [] { typeof(string) })] - string[] ContainedResource { get; set; } + System.Collections.Generic.List ContainedResource { get; set; } /// Resource ID. [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Resource ID.", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -177,6 +188,9 @@ public partial interface ISolution : [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Resource location", SerializedName = @"location", PossibleTypes = new [] { typeof(string) })] @@ -185,6 +199,9 @@ public partial interface ISolution : [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Resource name.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -196,6 +213,9 @@ public partial interface ISolution : [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"name of the solution to be created. For Microsoft published solution it should be in the format of solutionType(workspaceName). SolutionType part is case sensitive. For third party solution, it can be anything.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -207,6 +227,9 @@ public partial interface ISolution : [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"name of the solution to enabled/add. For Microsoft published gallery solution it should be in the format of OMSGallery/. This is case sensitive", SerializedName = @"product", PossibleTypes = new [] { typeof(string) })] @@ -215,6 +238,9 @@ public partial interface ISolution : [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"promotionCode, Not really used now, can you left as empty", SerializedName = @"promotionCode", PossibleTypes = new [] { typeof(string) })] @@ -223,6 +249,9 @@ public partial interface ISolution : [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Publisher name. For gallery solution, it is Microsoft.", SerializedName = @"publisher", PossibleTypes = new [] { typeof(string) })] @@ -231,6 +260,9 @@ public partial interface ISolution : [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The provisioning state for the solution.", SerializedName = @"provisioningState", PossibleTypes = new [] { typeof(string) })] @@ -241,22 +273,31 @@ public partial interface ISolution : [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The resources that will be referenced from this solution. Deleting any of those solution out of band will break the solution.", SerializedName = @"referencedResources", PossibleTypes = new [] { typeof(string) })] - string[] ReferencedResource { get; set; } + System.Collections.Generic.List ReferencedResource { get; set; } /// Resource tags [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Resource tags", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionTags) })] - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionTags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionTags) })] + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionTags Tag { get; set; } /// Resource type. [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Resource type.", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -267,6 +308,9 @@ public partial interface ISolution : [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The azure resourceId for the workspace where the solution will be deployed/enabled.", SerializedName = @"workspaceResourceId", PossibleTypes = new [] { typeof(string) })] @@ -281,7 +325,7 @@ internal partial interface ISolutionInternal /// The azure resources that will be contained within the solutions. They will be locked and gets deleted automatically when /// the solution is deleted. /// - string[] ContainedResource { get; set; } + System.Collections.Generic.List ContainedResource { get; set; } /// Resource ID. string Id { get; set; } /// Resource location @@ -291,7 +335,7 @@ internal partial interface ISolutionInternal /// /// Plan for solution object supported by the OperationsManagement resource provider. /// - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPlan Plan { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPlan Plan { get; set; } /// /// name of the solution to be created. For Microsoft published solution it should be in the format of solutionType(workspaceName). /// SolutionType part is case sensitive. For third party solution, it can be anything. @@ -309,15 +353,15 @@ internal partial interface ISolutionInternal /// /// Properties for solution object supported by the OperationsManagement resource provider. /// - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionProperties Property { get; set; } /// The provisioning state for the solution. string ProvisioningState { get; set; } /// /// The resources that will be referenced from this solution. Deleting any of those solution out of band will break the solution. /// - string[] ReferencedResource { get; set; } + System.Collections.Generic.List ReferencedResource { get; set; } /// Resource tags - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionTags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionTags Tag { get; set; } /// Resource type. string Type { get; set; } /// diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/Solution.json.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Solution.json.cs similarity index 92% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/Solution.json.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Solution.json.cs index 7a8c7775434a..7c235bd3346e 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/Solution.json.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Solution.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.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class Solution partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolution. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolution. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolution. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolution. /// - public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolution FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolution FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonObject json ? new Solution(json) : null; } @@ -77,13 +77,13 @@ internal Solution(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime { return; } - {_plan = If( json?.PropertyT("plan"), out var __jsonPlan) ? Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.SolutionPlan.FromJson(__jsonPlan) : Plan;} - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.SolutionProperties.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;} - {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)Location;} - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.SolutionTags.FromJson(__jsonTags) : Tag;} + {_plan = If( json?.PropertyT("plan"), out var __jsonPlan) ? Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.SolutionPlan.FromJson(__jsonPlan) : _plan;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.SolutionProperties.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;} + {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)_location;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.SolutionTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } @@ -108,15 +108,15 @@ public Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonN } AddIf( null != this._plan ? (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode) this._plan.ToJson(null,serializationMode) : null, "plan" ,container.Add ); AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); } diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionPatch.PowerShell.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionPatch.PowerShell.cs similarity index 75% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionPatch.PowerShell.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionPatch.PowerShell.cs index 9940417c4363..8fe09f413d16 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionPatch.PowerShell.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionPatch.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.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class SolutionPatch 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.MonitoringSolutions.Models.Api20151101Preview.ISolutionPatch DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPatch DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new SolutionPatch(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.MonitoringSolutions.Models.Api20151101Preview.ISolutionPatch DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPatch DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new SolutionPatch(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api2 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPatch FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPatch FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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,13 +111,13 @@ internal SolutionPatch(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPatchInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPatchTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPatchInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.SolutionPatchTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPatchInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPatchTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPatchInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.SolutionPatchTagsTypeConverter.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. @@ -126,7 +132,7 @@ internal SolutionPatch(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPatchInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPatchTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPatchInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.SolutionPatchTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPatchInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPatchTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPatchInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.SolutionPatchTagsTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } @@ -135,6 +141,18 @@ internal SolutionPatch(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 properties of a Solution that can be patched. [System.ComponentModel.TypeConverter(typeof(SolutionPatchTypeConverter))] diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionPatch.TypeConverter.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionPatch.TypeConverter.cs similarity index 97% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionPatch.TypeConverter.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionPatch.TypeConverter.cs index f2199aec0f91..00449d22eede 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionPatch.TypeConverter.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionPatch.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.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Models.Api20151101Preview.ISolutionPatch ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPatch ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPatch).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPatch).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionPatch.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionPatch.cs similarity index 77% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionPatch.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionPatch.cs index f0ec6ff5bc44..0be365fc0a9a 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionPatch.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionPatch.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.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Extensions; /// The properties of a Solution that can be patched. public partial class SolutionPatch : - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPatch, - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPatchInternal + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPatch, + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPatchInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPatchTags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPatchTags _tag; /// Resource tags [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Origin(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPatchTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.SolutionPatchTags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPatchTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.SolutionPatchTags()); set => this._tag = value; } /// Creates an new instance. public SolutionPatch() @@ -34,10 +34,13 @@ public partial interface ISolutionPatch : [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Resource tags", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPatchTags) })] - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPatchTags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPatchTags) })] + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPatchTags Tag { get; set; } } /// The properties of a Solution that can be patched. @@ -45,7 +48,7 @@ internal partial interface ISolutionPatchInternal { /// Resource tags - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPatchTags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPatchTags Tag { get; set; } } } \ No newline at end of file diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionPatch.json.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionPatch.json.cs similarity index 94% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionPatch.json.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionPatch.json.cs index e122d91bc75d..39561ef26c7d 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionPatch.json.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionPatch.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.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class SolutionPatch partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPatch. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPatch. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPatch. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPatch. /// - public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPatch FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPatch FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonObject json ? new SolutionPatch(json) : null; } @@ -77,7 +77,7 @@ internal SolutionPatch(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Ru { return; } - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.SolutionPatchTags.FromJson(__jsonTags) : Tag;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.SolutionPatchTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionPatchTags.PowerShell.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionPatchTags.PowerShell.cs similarity index 81% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionPatchTags.PowerShell.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionPatchTags.PowerShell.cs index 0801cab88d7d..9a7c448723f4 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionPatchTags.PowerShell.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionPatchTags.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.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class SolutionPatchTags 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.MonitoringSolutions.Models.Api20151101Preview.ISolutionPatchTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPatchTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new SolutionPatchTags(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.MonitoringSolutions.Models.Api20151101Preview.ISolutionPatchTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPatchTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new SolutionPatchTags(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api2 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPatchTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPatchTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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. @@ -109,7 +115,7 @@ internal SolutionPatchTags(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. @@ -131,6 +137,18 @@ internal SolutionPatchTags(global::System.Management.Automation.PSObject content /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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(); + } } /// Resource tags [System.ComponentModel.TypeConverter(typeof(SolutionPatchTagsTypeConverter))] diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionPatchTags.TypeConverter.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionPatchTags.TypeConverter.cs similarity index 97% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionPatchTags.TypeConverter.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionPatchTags.TypeConverter.cs index daf9b64af135..2f4890f02a85 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionPatchTags.TypeConverter.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionPatchTags.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.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Models.Api20151101Preview.ISolutionPatchTags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPatchTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPatchTags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPatchTags).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionPatchTags.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionPatchTags.cs similarity index 90% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionPatchTags.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionPatchTags.cs index 251d1fdb4695..ca6c0ae91fad 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionPatchTags.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionPatchTags.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.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Extensions; /// Resource tags public partial class SolutionPatchTags : - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPatchTags, - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPatchTagsInternal + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPatchTags, + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPatchTagsInternal { /// Creates an new instance. diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionPatchTags.dictionary.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionPatchTags.dictionary.cs similarity index 96% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionPatchTags.dictionary.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionPatchTags.dictionary.cs index 4e4c1fd8a4b0..1a00cbacd3ea 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionPatchTags.dictionary.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionPatchTags.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.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Models.Api20151101Preview.SolutionPatchTags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.SolutionPatchTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionPatchTags.json.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionPatchTags.json.cs similarity index 96% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionPatchTags.json.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionPatchTags.json.cs index 6d7a335d2793..477eed3cb219 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionPatchTags.json.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionPatchTags.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.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class SolutionPatchTags partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPatchTags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPatchTags. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPatchTags. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPatchTags. /// - public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPatchTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPatchTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonObject json ? new SolutionPatchTags(json) : null; } diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionPlan.PowerShell.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionPlan.PowerShell.cs similarity index 69% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionPlan.PowerShell.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionPlan.PowerShell.cs index 4fed3497fdbc..50f5db5d8513 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionPlan.PowerShell.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionPlan.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.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.PowerShell; @@ -57,29 +57,35 @@ public partial class SolutionPlan 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.MonitoringSolutions.Models.Api20151101Preview.ISolutionPlan DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPlan DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new SolutionPlan(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.MonitoringSolutions.Models.Api20151101Preview.ISolutionPlan DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPlan DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new SolutionPlan(content); } @@ -89,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api2 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPlan FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPlan FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 +113,25 @@ internal SolutionPlan(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPlanInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPlanInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPlanInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPlanInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Publisher")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPlanInternal)this).Publisher = (string) content.GetValueForProperty("Publisher",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPlanInternal)this).Publisher, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPlanInternal)this).Publisher = (string) content.GetValueForProperty("Publisher",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPlanInternal)this).Publisher, global::System.Convert.ToString); } if (content.Contains("PromotionCode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPlanInternal)this).PromotionCode = (string) content.GetValueForProperty("PromotionCode",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPlanInternal)this).PromotionCode, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPlanInternal)this).PromotionCode = (string) content.GetValueForProperty("PromotionCode",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPlanInternal)this).PromotionCode, global::System.Convert.ToString); } if (content.Contains("Product")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPlanInternal)this).Product = (string) content.GetValueForProperty("Product",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPlanInternal)this).Product, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPlanInternal)this).Product = (string) content.GetValueForProperty("Product",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPlanInternal)this).Product, 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 +146,19 @@ internal SolutionPlan(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPlanInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPlanInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPlanInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPlanInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Publisher")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPlanInternal)this).Publisher = (string) content.GetValueForProperty("Publisher",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPlanInternal)this).Publisher, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPlanInternal)this).Publisher = (string) content.GetValueForProperty("Publisher",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPlanInternal)this).Publisher, global::System.Convert.ToString); } if (content.Contains("PromotionCode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPlanInternal)this).PromotionCode = (string) content.GetValueForProperty("PromotionCode",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPlanInternal)this).PromotionCode, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPlanInternal)this).PromotionCode = (string) content.GetValueForProperty("PromotionCode",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPlanInternal)this).PromotionCode, global::System.Convert.ToString); } if (content.Contains("Product")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPlanInternal)this).Product = (string) content.GetValueForProperty("Product",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPlanInternal)this).Product, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPlanInternal)this).Product = (string) content.GetValueForProperty("Product",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPlanInternal)this).Product, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -161,6 +167,18 @@ internal SolutionPlan(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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(); + } } /// Plan for solution object supported by the OperationsManagement resource provider. [System.ComponentModel.TypeConverter(typeof(SolutionPlanTypeConverter))] diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionPlan.TypeConverter.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionPlan.TypeConverter.cs similarity index 97% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionPlan.TypeConverter.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionPlan.TypeConverter.cs index d18f473b52bf..99e3b57eca21 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionPlan.TypeConverter.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionPlan.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.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Models.Api20151101Preview.ISolutionPlan ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPlan ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPlan).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPlan).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionPlan.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionPlan.cs similarity index 95% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionPlan.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionPlan.cs index f73df9de94e2..a9a504b60656 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionPlan.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionPlan.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Extensions; @@ -11,8 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151 /// Plan for solution object supported by the OperationsManagement resource provider. /// public partial class SolutionPlan : - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPlan, - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPlanInternal + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPlan, + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPlanInternal { /// Backing field for property. @@ -66,6 +66,9 @@ public partial interface ISolutionPlan : [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"name of the solution to be created. For Microsoft published solution it should be in the format of solutionType(workspaceName). SolutionType part is case sensitive. For third party solution, it can be anything.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -77,6 +80,9 @@ public partial interface ISolutionPlan : [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"name of the solution to enabled/add. For Microsoft published gallery solution it should be in the format of OMSGallery/. This is case sensitive", SerializedName = @"product", PossibleTypes = new [] { typeof(string) })] @@ -85,6 +91,9 @@ public partial interface ISolutionPlan : [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"promotionCode, Not really used now, can you left as empty", SerializedName = @"promotionCode", PossibleTypes = new [] { typeof(string) })] @@ -93,6 +102,9 @@ public partial interface ISolutionPlan : [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Publisher name. For gallery solution, it is Microsoft.", SerializedName = @"publisher", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionPlan.json.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionPlan.json.cs similarity index 95% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionPlan.json.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionPlan.json.cs index 059031dab7b0..a3de3a23c24b 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionPlan.json.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionPlan.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.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class SolutionPlan partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPlan. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPlan. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPlan. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPlan. /// - public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPlan FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPlan FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonObject json ? new SolutionPlan(json) : null; } @@ -79,10 +79,10 @@ internal SolutionPlan(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Run { return; } - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_publisher = If( json?.PropertyT("publisher"), out var __jsonPublisher) ? (string)__jsonPublisher : (string)Publisher;} - {_promotionCode = If( json?.PropertyT("promotionCode"), out var __jsonPromotionCode) ? (string)__jsonPromotionCode : (string)PromotionCode;} - {_product = If( json?.PropertyT("product"), out var __jsonProduct) ? (string)__jsonProduct : (string)Product;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_publisher = If( json?.PropertyT("publisher"), out var __jsonPublisher) ? (string)__jsonPublisher : (string)_publisher;} + {_promotionCode = If( json?.PropertyT("promotionCode"), out var __jsonPromotionCode) ? (string)__jsonPromotionCode : (string)_promotionCode;} + {_product = If( json?.PropertyT("product"), out var __jsonProduct) ? (string)__jsonProduct : (string)_product;} AfterFromJson(json); } diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionProperties.PowerShell.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionProperties.PowerShell.cs similarity index 65% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionProperties.PowerShell.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionProperties.PowerShell.cs index 20aba290fa06..9b31e2634de7 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionProperties.PowerShell.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionProperties.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.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class SolutionProperties 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.MonitoringSolutions.Models.Api20151101Preview.ISolutionProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new SolutionProperties(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.MonitoringSolutions.Models.Api20151101Preview.ISolutionProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new SolutionProperties(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api2 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 SolutionProperties(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("WorkspaceResourceId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPropertiesInternal)this).WorkspaceResourceId = (string) content.GetValueForProperty("WorkspaceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPropertiesInternal)this).WorkspaceResourceId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPropertiesInternal)this).WorkspaceResourceId = (string) content.GetValueForProperty("WorkspaceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPropertiesInternal)this).WorkspaceResourceId, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("ContainedResource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPropertiesInternal)this).ContainedResource = (string[]) content.GetValueForProperty("ContainedResource",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPropertiesInternal)this).ContainedResource, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPropertiesInternal)this).ContainedResource = (System.Collections.Generic.List) content.GetValueForProperty("ContainedResource",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPropertiesInternal)this).ContainedResource, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("ReferencedResource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPropertiesInternal)this).ReferencedResource = (string[]) content.GetValueForProperty("ReferencedResource",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPropertiesInternal)this).ReferencedResource, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPropertiesInternal)this).ReferencedResource = (System.Collections.Generic.List) content.GetValueForProperty("ReferencedResource",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPropertiesInternal)this).ReferencedResource, __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. @@ -138,19 +144,19 @@ internal SolutionProperties(global::System.Management.Automation.PSObject conten // actually deserialize if (content.Contains("WorkspaceResourceId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPropertiesInternal)this).WorkspaceResourceId = (string) content.GetValueForProperty("WorkspaceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPropertiesInternal)this).WorkspaceResourceId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPropertiesInternal)this).WorkspaceResourceId = (string) content.GetValueForProperty("WorkspaceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPropertiesInternal)this).WorkspaceResourceId, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("ContainedResource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPropertiesInternal)this).ContainedResource = (string[]) content.GetValueForProperty("ContainedResource",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPropertiesInternal)this).ContainedResource, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPropertiesInternal)this).ContainedResource = (System.Collections.Generic.List) content.GetValueForProperty("ContainedResource",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPropertiesInternal)this).ContainedResource, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("ReferencedResource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPropertiesInternal)this).ReferencedResource = (string[]) content.GetValueForProperty("ReferencedResource",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPropertiesInternal)this).ReferencedResource, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPropertiesInternal)this).ReferencedResource = (System.Collections.Generic.List) content.GetValueForProperty("ReferencedResource",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPropertiesInternal)this).ReferencedResource, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializePSObject(content); } @@ -159,6 +165,18 @@ internal SolutionProperties(global::System.Management.Automation.PSObject conten /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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(); + } } /// Solution properties supported by the OperationsManagement resource provider. [System.ComponentModel.TypeConverter(typeof(SolutionPropertiesTypeConverter))] diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionProperties.TypeConverter.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionProperties.TypeConverter.cs similarity index 97% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionProperties.TypeConverter.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionProperties.TypeConverter.cs index f687c72d82b5..6ea80a2a93a4 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionProperties.TypeConverter.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionProperties.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.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Models.Api20151101Preview.ISolutionProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionProperties.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionProperties.cs similarity index 83% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionProperties.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionProperties.cs index 71df75045d11..235705065b09 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionProperties.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionProperties.cs @@ -3,28 +3,28 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Extensions; /// Solution properties supported by the OperationsManagement resource provider. public partial class SolutionProperties : - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionProperties, - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionProperties, + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPropertiesInternal { /// Backing field for property. - private string[] _containedResource; + private System.Collections.Generic.List _containedResource; /// /// The azure resources that will be contained within the solutions. They will be locked and gets deleted automatically when /// the solution is deleted. /// [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Origin(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.PropertyOrigin.Owned)] - public string[] ContainedResource { get => this._containedResource; set => this._containedResource = value; } + public System.Collections.Generic.List ContainedResource { get => this._containedResource; set => this._containedResource = value; } /// Internal Acessors for ProvisioningState - string Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } /// Backing field for property. private string _provisioningState; @@ -34,13 +34,13 @@ public partial class SolutionProperties : public string ProvisioningState { get => this._provisioningState; } /// Backing field for property. - private string[] _referencedResource; + private System.Collections.Generic.List _referencedResource; /// /// The resources that will be referenced from this solution. Deleting any of those solution out of band will break the solution. /// [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Origin(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.PropertyOrigin.Owned)] - public string[] ReferencedResource { get => this._referencedResource; set => this._referencedResource = value; } + public System.Collections.Generic.List ReferencedResource { get => this._referencedResource; set => this._referencedResource = value; } /// Backing field for property. private string _workspaceResourceId; @@ -68,14 +68,20 @@ public partial interface ISolutionProperties : [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The azure resources that will be contained within the solutions. They will be locked and gets deleted automatically when the solution is deleted.", SerializedName = @"containedResources", PossibleTypes = new [] { typeof(string) })] - string[] ContainedResource { get; set; } + System.Collections.Generic.List ContainedResource { get; set; } /// The provisioning state for the solution. [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The provisioning state for the solution.", SerializedName = @"provisioningState", PossibleTypes = new [] { typeof(string) })] @@ -86,16 +92,22 @@ public partial interface ISolutionProperties : [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The resources that will be referenced from this solution. Deleting any of those solution out of band will break the solution.", SerializedName = @"referencedResources", PossibleTypes = new [] { typeof(string) })] - string[] ReferencedResource { get; set; } + System.Collections.Generic.List ReferencedResource { get; set; } /// /// The azure resourceId for the workspace where the solution will be deployed/enabled. /// [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The azure resourceId for the workspace where the solution will be deployed/enabled.", SerializedName = @"workspaceResourceId", PossibleTypes = new [] { typeof(string) })] @@ -110,13 +122,13 @@ internal partial interface ISolutionPropertiesInternal /// The azure resources that will be contained within the solutions. They will be locked and gets deleted automatically when /// the solution is deleted. /// - string[] ContainedResource { get; set; } + System.Collections.Generic.List ContainedResource { get; set; } /// The provisioning state for the solution. string ProvisioningState { get; set; } /// /// The resources that will be referenced from this solution. Deleting any of those solution out of band will break the solution. /// - string[] ReferencedResource { get; set; } + System.Collections.Generic.List ReferencedResource { get; set; } /// /// The azure resourceId for the workspace where the solution will be deployed/enabled. /// diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionProperties.json.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionProperties.json.cs similarity index 90% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionProperties.json.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionProperties.json.cs index 008a9d425c27..76152be93c52 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionProperties.json.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionProperties.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.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class SolutionProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonObject json ? new SolutionProperties(json) : null; } @@ -77,10 +77,10 @@ internal SolutionProperties(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutio { return; } - {_workspaceResourceId = If( json?.PropertyT("workspaceResourceId"), out var __jsonWorkspaceResourceId) ? (string)__jsonWorkspaceResourceId : (string)WorkspaceResourceId;} - {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} - {_containedResource = If( json?.PropertyT("containedResources"), out var __jsonContainedResources) ? If( __jsonContainedResources as Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : ContainedResource;} - {_referencedResource = If( json?.PropertyT("referencedResources"), out var __jsonReferencedResources) ? If( __jsonReferencedResources as Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : ReferencedResource;} + {_workspaceResourceId = If( json?.PropertyT("workspaceResourceId"), out var __jsonWorkspaceResourceId) ? (string)__jsonWorkspaceResourceId : (string)_workspaceResourceId;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} + {_containedResource = If( json?.PropertyT("containedResources"), out var __jsonContainedResources) ? If( __jsonContainedResources as Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _containedResource;} + {_referencedResource = If( json?.PropertyT("referencedResources"), out var __jsonReferencedResources) ? If( __jsonReferencedResources as Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : _referencedResource;} AfterFromJson(json); } @@ -104,7 +104,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonN return container; } AddIf( null != (((object)this._workspaceResourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonString(this._workspaceResourceId.ToString()) : null, "workspaceResourceId" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); } diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionPropertiesList.PowerShell.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionPropertiesList.PowerShell.cs similarity index 72% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionPropertiesList.PowerShell.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionPropertiesList.PowerShell.cs index 2be14fc061aa..03285bc3c207 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionPropertiesList.PowerShell.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionPropertiesList.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.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class SolutionPropertiesList 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.MonitoringSolutions.Models.Api20151101Preview.ISolutionPropertiesList DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPropertiesList DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new SolutionPropertiesList(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.MonitoringSolutions.Models.Api20151101Preview.ISolutionPropertiesList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPropertiesList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new SolutionPropertiesList(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api2 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPropertiesList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPropertiesList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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,13 +111,13 @@ internal SolutionPropertiesList(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPropertiesListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolution[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPropertiesListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.SolutionTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPropertiesListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPropertiesListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.SolutionTypeConverter.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. @@ -126,7 +132,7 @@ internal SolutionPropertiesList(global::System.Management.Automation.PSObject co // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPropertiesListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolution[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPropertiesListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.SolutionTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPropertiesListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPropertiesListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.SolutionTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } @@ -135,6 +141,18 @@ internal SolutionPropertiesList(global::System.Management.Automation.PSObject co /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 list of solution response [System.ComponentModel.TypeConverter(typeof(SolutionPropertiesListTypeConverter))] diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionPropertiesList.TypeConverter.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionPropertiesList.TypeConverter.cs similarity index 97% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionPropertiesList.TypeConverter.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionPropertiesList.TypeConverter.cs index d07dc851e37f..ace495d27238 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionPropertiesList.TypeConverter.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionPropertiesList.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.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Models.Api20151101Preview.ISolutionPropertiesList ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPropertiesList ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPropertiesList).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPropertiesList).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionPropertiesList.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionPropertiesList.cs similarity index 71% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionPropertiesList.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionPropertiesList.cs index 237c5d752007..fe8c33ff6eb7 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionPropertiesList.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionPropertiesList.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.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Extensions; /// the list of solution response public partial class SolutionPropertiesList : - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPropertiesList, - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPropertiesListInternal + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPropertiesList, + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPropertiesListInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolution[] _value; + private System.Collections.Generic.List _value; /// List of solution properties within the subscription. [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Origin(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolution[] 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 SolutionPropertiesList() @@ -34,10 +34,13 @@ public partial interface ISolutionPropertiesList : [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"List of solution properties within the subscription.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolution) })] - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolution[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolution) })] + System.Collections.Generic.List Value { get; set; } } /// the list of solution response @@ -45,7 +48,7 @@ internal partial interface ISolutionPropertiesListInternal { /// List of solution properties within the subscription. - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolution[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionPropertiesList.json.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionPropertiesList.json.cs similarity index 90% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionPropertiesList.json.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionPropertiesList.json.cs index 2cb3d9e7a6e1..a300623e9a1e 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionPropertiesList.json.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionPropertiesList.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.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class SolutionPropertiesList partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPropertiesList. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPropertiesList. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPropertiesList. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPropertiesList. /// - public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPropertiesList FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPropertiesList FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonObject json ? new SolutionPropertiesList(json) : null; } @@ -77,7 +77,7 @@ internal SolutionPropertiesList(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSol { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Models.Api20151101Preview.ISolution) (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.Solution.FromJson(__u) )) ))() : null : Value;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Models.ISolution) (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Solution.FromJson(__u) )) ))() : null : _value;} AfterFromJson(json); } diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionTags.PowerShell.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionTags.PowerShell.cs similarity index 81% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionTags.PowerShell.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionTags.PowerShell.cs index 5828e29e8092..daec6ee5c3d3 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionTags.PowerShell.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionTags.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.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class SolutionTags 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.MonitoringSolutions.Models.Api20151101Preview.ISolutionTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new SolutionTags(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.MonitoringSolutions.Models.Api20151101Preview.ISolutionTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new SolutionTags(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api2 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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. @@ -109,7 +115,7 @@ internal SolutionTags(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. @@ -131,6 +137,18 @@ internal SolutionTags(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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(); + } } /// Resource tags [System.ComponentModel.TypeConverter(typeof(SolutionTagsTypeConverter))] diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionTags.TypeConverter.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionTags.TypeConverter.cs similarity index 97% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionTags.TypeConverter.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionTags.TypeConverter.cs index e7a65dfc36ec..40672f23215f 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionTags.TypeConverter.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionTags.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.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Models.Api20151101Preview.ISolutionTags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionTags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionTags).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionTags.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionTags.cs similarity index 91% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionTags.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionTags.cs index 9381ad640896..35e8ce8f08d3 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionTags.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionTags.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.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Extensions; /// Resource tags public partial class SolutionTags : - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionTags, - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionTagsInternal + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionTags, + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionTagsInternal { /// Creates an new instance. diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionTags.dictionary.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionTags.dictionary.cs similarity index 96% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionTags.dictionary.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionTags.dictionary.cs index 064e2c1d4983..e2c73b4b88da 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionTags.dictionary.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionTags.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.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Models.Api20151101Preview.SolutionTags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.SolutionTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionTags.json.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionTags.json.cs similarity index 96% rename from generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionTags.json.cs rename to generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionTags.json.cs index 3bed98ba4302..fae637b465dc 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/Api20151101Preview/SolutionTags.json.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/Models/SolutionTags.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.MonitoringSolutions.Models.Api20151101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models { using static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class SolutionTags partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionTags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionTags. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionTags. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionTags. /// - public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonObject json ? new SolutionTags(json) : null; } diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/MonitoringSolutions.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/MonitoringSolutions.cs index 5b46249f8464..8e3ae44dec3a 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/MonitoringSolutions.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/api/MonitoringSolutions.cs @@ -14,7 +14,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions public partial class MonitoringSolutions { - /// Creates or updates the ManagementAssociation. + /// update the ManagementAssociation. /// Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription /// ID forms part of the URI for every service call. /// The name of the resource group to get. The name is case insensitive. @@ -28,10 +28,11 @@ public partial class MonitoringSolutions /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 ManagementAssociationsCreateOrUpdate(string subscriptionId, string resourceGroupName, string providerName, string resourceType, string resourceName, string managementAssociationName, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociation body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ManagementAssociationsCreateOrUpdate(string subscriptionId, string resourceGroupName, string providerName, string resourceType, string resourceName, string managementAssociationName, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociation body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2015-11-01-preview"; // Constant Parameters @@ -64,15 +65,15 @@ public partial class MonitoringSolutions await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ManagementAssociationsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.ManagementAssociationsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Creates or updates the ManagementAssociation. + /// update the ManagementAssociation. /// /// The parameters required to create ManagementAssociation extension. /// a delegate that is called when the remote service returns 200 (OK). @@ -80,10 +81,11 @@ public partial class MonitoringSolutions /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 ManagementAssociationsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociation body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ManagementAssociationsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociation body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2015-11-01-preview"; // Constant Parameters @@ -131,16 +133,315 @@ public partial class MonitoringSolutions await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ManagementAssociationsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.ManagementAssociationsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// update the ManagementAssociation. + /// + /// The parameters required to create ManagementAssociation extension. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 ManagementAssociationsCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociation body, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2015-11-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/(?[^/]+)/resourcegroups/(?[^/]+)/providers/(?[^/]+)/(?[^/]+)/(?[^/]+)/providers/Microsoft.OperationsManagement/ManagementAssociations/(?[^/]+)$", 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/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.OperationsManagement/ManagementAssociations/{managementAssociationName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var providerName = _match.Groups["providerName"].Value; + var resourceType = _match.Groups["resourceType"].Value; + var resourceName = _match.Groups["resourceName"].Value; + var managementAssociationName = _match.Groups["managementAssociationName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourcegroups/" + + resourceGroupName + + "/providers/" + + providerName + + "/" + + resourceType + + "/" + + resourceName + + "/providers/Microsoft.OperationsManagement/ManagementAssociations/" + + managementAssociationName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ManagementAssociationsCreateOrUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// update the ManagementAssociation. + /// Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group to get. The name is case insensitive. + /// Provider name for the parent resource. + /// Resource type for the parent resource + /// Parent resource name. + /// User ManagementAssociation Name. + /// Json string supplied to the ManagementAssociationsCreateOrUpdate 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.MonitoringSolutions.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 ManagementAssociationsCreateOrUpdateViaJsonString(string subscriptionId, string resourceGroupName, string providerName, string resourceType, string resourceName, string managementAssociationName, 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.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) + { + var apiVersion = @"2015-11-01-preview"; + // 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/" + + global::System.Uri.EscapeDataString(providerName) + + "/" + + global::System.Uri.EscapeDataString(resourceType) + + "/" + + global::System.Uri.EscapeDataString(resourceName) + + "/providers/Microsoft.OperationsManagement/ManagementAssociations/" + + global::System.Uri.EscapeDataString(managementAssociationName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagementAssociationsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// update the ManagementAssociation. + /// Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group to get. The name is case insensitive. + /// Provider name for the parent resource. + /// Resource type for the parent resource + /// Parent resource name. + /// User ManagementAssociation Name. + /// Json string supplied to the ManagementAssociationsCreateOrUpdate operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 ManagementAssociationsCreateOrUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string providerName, string resourceType, string resourceName, string managementAssociationName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) + { + var apiVersion = @"2015-11-01-preview"; + // 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/" + + global::System.Uri.EscapeDataString(providerName) + + "/" + + global::System.Uri.EscapeDataString(resourceType) + + "/" + + global::System.Uri.EscapeDataString(resourceName) + + "/providers/Microsoft.OperationsManagement/ManagementAssociations/" + + global::System.Uri.EscapeDataString(managementAssociationName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ManagementAssociationsCreateOrUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// update the ManagementAssociation. + /// Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group to get. The name is case insensitive. + /// Provider name for the parent resource. + /// Resource type for the parent resource + /// Parent resource name. + /// User ManagementAssociation Name. + /// The parameters required to create ManagementAssociation extension. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 ManagementAssociationsCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string providerName, string resourceType, string resourceName, string managementAssociationName, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociation body, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2015-11-01-preview"; + // 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/" + + global::System.Uri.EscapeDataString(providerName) + + "/" + + global::System.Uri.EscapeDataString(resourceType) + + "/" + + global::System.Uri.EscapeDataString(resourceName) + + "/providers/Microsoft.OperationsManagement/ManagementAssociations/" + + global::System.Uri.EscapeDataString(managementAssociationName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ManagementAssociationsCreateOrUpdateWithResult_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.MonitoringSolutions.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 ManagementAssociationsCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ManagementAssociation.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.CodeMessageError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.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.MonitoringSolutions.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). @@ -151,7 +452,7 @@ public partial class MonitoringSolutions /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ManagementAssociationsCreateOrUpdate_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.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ManagementAssociationsCreateOrUpdate_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.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -162,6 +463,7 @@ public partial class MonitoringSolutions await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -169,13 +471,13 @@ public partial class MonitoringSolutions case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ManagementAssociation.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ManagementAssociation.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.CodeMessageError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.CodeMessageError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -206,7 +508,7 @@ public partial class MonitoringSolutions /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ManagementAssociationsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string providerName, string resourceType, string resourceName, string managementAssociationName, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementAssociation body, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ManagementAssociationsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string providerName, string resourceType, string resourceName, string managementAssociationName, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementAssociation body, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -214,7 +516,7 @@ public partial class MonitoringSolutions await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); await eventListener.AssertNotNull(nameof(providerName),providerName); await eventListener.AssertNotNull(nameof(resourceType),resourceType); await eventListener.AssertNotNull(nameof(resourceName),resourceName); @@ -240,7 +542,7 @@ public partial class MonitoringSolutions /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ManagementAssociationsDelete(string subscriptionId, string resourceGroupName, string providerName, string resourceType, string resourceName, string managementAssociationName, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ManagementAssociationsDelete(string subscriptionId, string resourceGroupName, string providerName, string resourceType, string resourceName, string managementAssociationName, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) { var apiVersion = @"2015-11-01-preview"; // Constant Parameters @@ -273,7 +575,7 @@ public partial class MonitoringSolutions await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ManagementAssociationsDelete_Call(request,onOk,onDefault,eventListener,sender); + await this.ManagementAssociationsDelete_Call (request, onOk,onDefault,eventListener,sender); } } @@ -287,7 +589,7 @@ public partial class MonitoringSolutions /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ManagementAssociationsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ManagementAssociationsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) { var apiVersion = @"2015-11-01-preview"; // Constant Parameters @@ -335,11 +637,11 @@ public partial class MonitoringSolutions await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ManagementAssociationsDelete_Call(request,onOk,onDefault,eventListener,sender); + await this.ManagementAssociationsDelete_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 @@ -349,7 +651,7 @@ public partial class MonitoringSolutions /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ManagementAssociationsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ManagementAssociationsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -360,6 +662,7 @@ public partial class MonitoringSolutions await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -373,7 +676,7 @@ public partial class MonitoringSolutions default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.CodeMessageError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.CodeMessageError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -411,7 +714,7 @@ public partial class MonitoringSolutions await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); await eventListener.AssertNotNull(nameof(providerName),providerName); await eventListener.AssertNotNull(nameof(resourceType),resourceType); await eventListener.AssertNotNull(nameof(resourceName),resourceName); @@ -435,7 +738,7 @@ public partial class MonitoringSolutions /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ManagementAssociationsGet(string subscriptionId, string resourceGroupName, string providerName, string resourceType, string resourceName, string managementAssociationName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ManagementAssociationsGet(string subscriptionId, string resourceGroupName, string providerName, string resourceType, string resourceName, string managementAssociationName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) { var apiVersion = @"2015-11-01-preview"; // Constant Parameters @@ -468,7 +771,7 @@ public partial class MonitoringSolutions await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ManagementAssociationsGet_Call(request,onOk,onDefault,eventListener,sender); + await this.ManagementAssociationsGet_Call (request, onOk,onDefault,eventListener,sender); } } @@ -482,7 +785,7 @@ public partial class MonitoringSolutions /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ManagementAssociationsGetViaIdentity(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.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ManagementAssociationsGetViaIdentity(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.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) { var apiVersion = @"2015-11-01-preview"; // Constant Parameters @@ -530,45 +833,219 @@ public partial class MonitoringSolutions await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ManagementAssociationsGet_Call(request,onOk,onDefault,eventListener,sender); + await this.ManagementAssociationsGet_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). + /// Retrieves the user ManagementAssociation. + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 ManagementAssociationsGet_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.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ManagementAssociationsGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) { + var apiVersion = @"2015-11-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.MonitoringSolutions.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // verify that Identity format is an exact match for uri - switch ( _response.StatusCode ) - { + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourcegroups/(?[^/]+)/providers/(?[^/]+)/(?[^/]+)/(?[^/]+)/providers/Microsoft.OperationsManagement/ManagementAssociations/(?[^/]+)$", 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/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.OperationsManagement/ManagementAssociations/{managementAssociationName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var providerName = _match.Groups["providerName"].Value; + var resourceType = _match.Groups["resourceType"].Value; + var resourceName = _match.Groups["resourceName"].Value; + var managementAssociationName = _match.Groups["managementAssociationName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourcegroups/" + + resourceGroupName + + "/providers/" + + providerName + + "/" + + resourceType + + "/" + + resourceName + + "/providers/Microsoft.OperationsManagement/ManagementAssociations/" + + managementAssociationName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ManagementAssociationsGetWithResult_Call (request, eventListener,sender); + } + } + + /// Retrieves the user ManagementAssociation. + /// Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group to get. The name is case insensitive. + /// Provider name for the parent resource. + /// Resource type for the parent resource + /// Parent resource name. + /// User ManagementAssociation Name. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 ManagementAssociationsGetWithResult(string subscriptionId, string resourceGroupName, string providerName, string resourceType, string resourceName, string managementAssociationName, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) + { + var apiVersion = @"2015-11-01-preview"; + // 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/" + + global::System.Uri.EscapeDataString(providerName) + + "/" + + global::System.Uri.EscapeDataString(resourceType) + + "/" + + global::System.Uri.EscapeDataString(resourceName) + + "/providers/Microsoft.OperationsManagement/ManagementAssociations/" + + global::System.Uri.EscapeDataString(managementAssociationName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ManagementAssociationsGetWithResult_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.MonitoringSolutions.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 ManagementAssociationsGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ManagementAssociation.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.CodeMessageError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.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.MonitoringSolutions.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.MonitoringSolutions.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 ManagementAssociationsGet_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.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ManagementAssociation.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ManagementAssociation.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.CodeMessageError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.CodeMessageError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -606,7 +1083,7 @@ public partial class MonitoringSolutions await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); await eventListener.AssertNotNull(nameof(providerName),providerName); await eventListener.AssertNotNull(nameof(resourceType),resourceType); await eventListener.AssertNotNull(nameof(resourceName),resourceName); @@ -625,7 +1102,7 @@ public partial class MonitoringSolutions /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ManagementAssociationsListBySubscription(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ManagementAssociationsListBySubscription(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) { var apiVersion = @"2015-11-01-preview"; // Constant Parameters @@ -649,7 +1126,7 @@ public partial class MonitoringSolutions await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ManagementAssociationsListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + await this.ManagementAssociationsListBySubscription_Call (request, onOk,onDefault,eventListener,sender); } } @@ -663,7 +1140,7 @@ public partial class MonitoringSolutions /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ManagementAssociationsListBySubscriptionViaIdentity(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.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ManagementAssociationsListBySubscriptionViaIdentity(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.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) { var apiVersion = @"2015-11-01-preview"; // Constant Parameters @@ -697,12 +1174,157 @@ public partial class MonitoringSolutions await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ManagementAssociationsListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + await this.ManagementAssociationsListBySubscription_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Retrieves the ManagementAssociations list. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 ManagementAssociationsListBySubscriptionViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) + { + var apiVersion = @"2015-11-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.OperationsManagement/ManagementAssociations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.OperationsManagement/ManagementAssociations'"); + } + + // 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.OperationsManagement/ManagementAssociations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ManagementAssociationsListBySubscriptionWithResult_Call (request, eventListener,sender); + } + } + + /// Retrieves the ManagementAssociations list. + /// Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 ManagementAssociationsListBySubscriptionWithResult(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) + { + var apiVersion = @"2015-11-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.OperationsManagement/ManagementAssociations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ManagementAssociationsListBySubscriptionWithResult_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.MonitoringSolutions.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 ManagementAssociationsListBySubscriptionWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ManagementAssociationPropertiesList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.CodeMessageError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.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.MonitoringSolutions.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). @@ -713,7 +1335,7 @@ public partial class MonitoringSolutions /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ManagementAssociationsListBySubscription_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.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ManagementAssociationsListBySubscription_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.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -724,6 +1346,7 @@ public partial class MonitoringSolutions await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -731,13 +1354,13 @@ public partial class MonitoringSolutions case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ManagementAssociationPropertiesList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ManagementAssociationPropertiesList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.CodeMessageError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.CodeMessageError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -770,7 +1393,7 @@ public partial class MonitoringSolutions } } - /// Creates or updates the ManagementConfiguration. + /// update the ManagementConfiguration. /// Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription /// ID forms part of the URI for every service call. /// The name of the resource group to get. The name is case insensitive. @@ -781,10 +1404,11 @@ public partial class MonitoringSolutions /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 ManagementConfigurationsCreateOrUpdate(string subscriptionId, string resourceGroupName, string managementConfigurationName, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfiguration body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ManagementConfigurationsCreateOrUpdate(string subscriptionId, string resourceGroupName, string managementConfigurationName, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfiguration body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2015-11-01-preview"; // Constant Parameters @@ -811,15 +1435,15 @@ public partial class MonitoringSolutions await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ManagementConfigurationsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.ManagementConfigurationsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Creates or updates the ManagementConfiguration. + /// update the ManagementConfiguration. /// /// The parameters required to create OMS Solution. /// a delegate that is called when the remote service returns 200 (OK). @@ -827,10 +1451,11 @@ public partial class MonitoringSolutions /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 ManagementConfigurationsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfiguration body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ManagementConfigurationsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfiguration body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2015-11-01-preview"; // Constant Parameters @@ -869,107 +1494,133 @@ public partial class MonitoringSolutions await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ManagementConfigurationsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.ManagementConfigurationsCreateOrUpdate_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 the ManagementConfiguration. + /// + /// The parameters required to create OMS Solution. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 ManagementConfigurationsCreateOrUpdate_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.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ManagementConfigurationsCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfiguration body, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2015-11-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.MonitoringSolutions.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ManagementConfiguration.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.CodeMessageError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourcegroups/(?[^/]+)/providers/Microsoft.OperationsManagement/ManagementConfigurations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationsManagement/ManagementConfigurations/{managementConfigurationName}'"); } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managementConfigurationName = _match.Groups["managementConfigurationName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourcegroups/" + + resourceGroupName + + "/providers/Microsoft.OperationsManagement/ManagementConfigurations/" + + managementConfigurationName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ManagementConfigurationsCreateOrUpdateWithResult_Call (request, eventListener,sender); } } - /// - /// Validation method for method. Call this like the actual call, but - /// you will get validation events back. - /// + /// update the ManagementConfiguration. /// Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription /// ID forms part of the URI for every service call. /// The name of the resource group to get. The name is case insensitive. /// User Management Configuration Name. - /// The parameters required to create OMS Solution. + /// Json string supplied to the ManagementConfigurationsCreateOrUpdate 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.MonitoringSolutions.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 ManagementConfigurationsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string managementConfigurationName, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IManagementConfiguration body, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener) + public async global::System.Threading.Tasks.Task ManagementConfigurationsCreateOrUpdateViaJsonString(string subscriptionId, string resourceGroupName, string managementConfigurationName, 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.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) { + var apiVersion = @"2015-11-01-preview"; + // Constant Parameters using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); - await eventListener.AssertNotNull(nameof(managementConfigurationName),managementConfigurationName); - 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.OperationsManagement/ManagementConfigurations/" + + global::System.Uri.EscapeDataString(managementConfigurationName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagementConfigurationsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Deletes the ManagementConfiguration in the subscription. + /// update the ManagementConfiguration. /// Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription /// ID forms part of the URI for every service call. /// The name of the resource group to get. The name is case insensitive. /// User Management Configuration Name. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Json string supplied to the ManagementConfigurationsCreateOrUpdate operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 ManagementConfigurationsDelete(string subscriptionId, string resourceGroupName, string managementConfigurationName, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ManagementConfigurationsCreateOrUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string managementConfigurationName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) { var apiVersion = @"2015-11-01-preview"; // Constant Parameters @@ -987,73 +1638,136 @@ public partial class MonitoringSolutions + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Method.Delete, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ManagementConfigurationsDelete_Call(request,onOk,onDefault,eventListener,sender); + return await this.ManagementConfigurationsCreateOrUpdateWithResult_Call (request, eventListener,sender); } } - /// Deletes the ManagementConfiguration in the subscription. - /// - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// update the ManagementConfiguration. + /// Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group to get. The name is case insensitive. + /// User Management Configuration Name. + /// The parameters required to create OMS Solution. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 ManagementConfigurationsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ManagementConfigurationsCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string managementConfigurationName, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfiguration body, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2015-11-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/(?[^/]+)/resourcegroups/(?[^/]+)/providers/Microsoft.OperationsManagement/ManagementConfigurations/(?[^/]+)$", 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.OperationsManagement/ManagementConfigurations/{managementConfigurationName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var managementConfigurationName = _match.Groups["managementConfigurationName"].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.OperationsManagement/ManagementConfigurations/" - + managementConfigurationName + + global::System.Uri.EscapeDataString(managementConfigurationName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Method.Delete, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ManagementConfigurationsDelete_Call(request,onOk,onDefault,eventListener,sender); + return await this.ManagementConfigurationsCreateOrUpdateWithResult_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.MonitoringSolutions.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 ManagementConfigurationsCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ManagementConfiguration.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.CodeMessageError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.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.MonitoringSolutions.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 @@ -1063,7 +1777,7 @@ public partial class MonitoringSolutions /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ManagementConfigurationsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ManagementConfigurationsCreateOrUpdate_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.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -1074,6 +1788,7 @@ public partial class MonitoringSolutions await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -1081,13 +1796,13 @@ public partial class MonitoringSolutions case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ManagementConfiguration.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.CodeMessageError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.CodeMessageError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -1103,18 +1818,19 @@ public partial class MonitoringSolutions } /// - /// 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. /// /// Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription /// ID forms part of the URI for every service call. /// The name of the resource group to get. The name is case insensitive. /// User Management Configuration Name. + /// The parameters required to create OMS Solution. /// 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 ManagementConfigurationsDelete_Validate(string subscriptionId, string resourceGroupName, string managementConfigurationName, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ManagementConfigurationsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string managementConfigurationName, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IManagementConfiguration body, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -1122,12 +1838,14 @@ public partial class MonitoringSolutions await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); await eventListener.AssertNotNull(nameof(managementConfigurationName),managementConfigurationName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Retrieves the user ManagementConfiguration. + /// Deletes the ManagementConfiguration in the subscription. /// Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription /// ID forms part of the URI for every service call. /// The name of the resource group to get. The name is case insensitive. @@ -1140,7 +1858,7 @@ public partial class MonitoringSolutions /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ManagementConfigurationsGet(string subscriptionId, string resourceGroupName, string managementConfigurationName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ManagementConfigurationsDelete(string subscriptionId, string resourceGroupName, string managementConfigurationName, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) { var apiVersion = @"2015-11-01-preview"; // Constant Parameters @@ -1162,16 +1880,16 @@ public partial class MonitoringSolutions // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ManagementConfigurationsGet_Call(request,onOk,onDefault,eventListener,sender); + await this.ManagementConfigurationsDelete_Call (request, onOk,onDefault,eventListener,sender); } } - /// Retrieves the user ManagementConfiguration. + /// Deletes the ManagementConfiguration in the subscription. /// /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -1181,7 +1899,7 @@ public partial class MonitoringSolutions /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ManagementConfigurationsGetViaIdentity(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.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ManagementConfigurationsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) { var apiVersion = @"2015-11-01-preview"; // Constant Parameters @@ -1215,16 +1933,16 @@ public partial class MonitoringSolutions // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ManagementConfigurationsGet_Call(request,onOk,onDefault,eventListener,sender); + await this.ManagementConfigurationsDelete_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 @@ -1234,7 +1952,7 @@ public partial class MonitoringSolutions /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ManagementConfigurationsGet_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.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ManagementConfigurationsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -1245,6 +1963,7 @@ public partial class MonitoringSolutions await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -1252,13 +1971,13 @@ public partial class MonitoringSolutions case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ManagementConfiguration.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.CodeMessageError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.CodeMessageError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -1274,7 +1993,7 @@ public partial class MonitoringSolutions } /// - /// Validation method for method. Call this like the actual call, but you will + /// Validation method for method. Call this like the actual call, but you will /// get validation events back. /// /// Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription @@ -1285,7 +2004,7 @@ public partial class MonitoringSolutions /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ManagementConfigurationsGet_Validate(string subscriptionId, string resourceGroupName, string managementConfigurationName, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ManagementConfigurationsDelete_Validate(string subscriptionId, string resourceGroupName, string managementConfigurationName, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -1293,14 +2012,16 @@ public partial class MonitoringSolutions await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); await eventListener.AssertNotNull(nameof(managementConfigurationName),managementConfigurationName); } } - /// Retrieves the ManagementConfigurations list. + /// Retrieves the user ManagementConfiguration. /// Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription /// ID forms part of the URI for every service call. + /// The name of the resource group to get. The name is case insensitive. + /// User Management Configuration Name. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -1309,7 +2030,7 @@ public partial class MonitoringSolutions /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ManagementConfigurationsListBySubscription(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ManagementConfigurationsGet(string subscriptionId, string resourceGroupName, string managementConfigurationName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) { var apiVersion = @"2015-11-01-preview"; // Constant Parameters @@ -1319,7 +2040,10 @@ public partial class MonitoringSolutions var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + global::System.Uri.EscapeDataString(subscriptionId) - + "/providers/Microsoft.OperationsManagement/ManagementConfigurations" + + "/resourcegroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.OperationsManagement/ManagementConfigurations/" + + global::System.Uri.EscapeDataString(managementConfigurationName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -1333,11 +2057,11 @@ public partial class MonitoringSolutions await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ManagementConfigurationsListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + await this.ManagementConfigurationsGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Retrieves the ManagementConfigurations list. + /// Retrieves the user ManagementConfiguration. /// /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -1347,7 +2071,7 @@ public partial class MonitoringSolutions /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ManagementConfigurationsListBySubscriptionViaIdentity(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.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ManagementConfigurationsGetViaIdentity(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.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) { var apiVersion = @"2015-11-01-preview"; // Constant Parameters @@ -1355,19 +2079,24 @@ public partial class MonitoringSolutions { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.OperationsManagement/ManagementConfigurations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourcegroups/(?[^/]+)/providers/Microsoft.OperationsManagement/ManagementConfigurations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.OperationsManagement/ManagementConfigurations'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationsManagement/ManagementConfigurations/{managementConfigurationName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managementConfigurationName = _match.Groups["managementConfigurationName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId - + "/providers/Microsoft.OperationsManagement/ManagementConfigurations" + + "/resourcegroups/" + + resourceGroupName + + "/providers/Microsoft.OperationsManagement/ManagementConfigurations/" + + managementConfigurationName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -1381,47 +2110,201 @@ public partial class MonitoringSolutions await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ManagementConfigurationsListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + await this.ManagementConfigurationsGet_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). + /// Retrieves the user ManagementConfiguration. + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 ManagementConfigurationsListBySubscription_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.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ManagementConfigurationsGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) { + var apiVersion = @"2015-11-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.MonitoringSolutions.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // verify that Identity format is an exact match for uri - switch ( _response.StatusCode ) - { + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourcegroups/(?[^/]+)/providers/Microsoft.OperationsManagement/ManagementConfigurations/(?[^/]+)$", 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.OperationsManagement/ManagementConfigurations/{managementConfigurationName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managementConfigurationName = _match.Groups["managementConfigurationName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourcegroups/" + + resourceGroupName + + "/providers/Microsoft.OperationsManagement/ManagementConfigurations/" + + managementConfigurationName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ManagementConfigurationsGetWithResult_Call (request, eventListener,sender); + } + } + + /// Retrieves the user ManagementConfiguration. + /// Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group to get. The name is case insensitive. + /// User Management Configuration Name. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 ManagementConfigurationsGetWithResult(string subscriptionId, string resourceGroupName, string managementConfigurationName, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) + { + var apiVersion = @"2015-11-01-preview"; + // 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.OperationsManagement/ManagementConfigurations/" + + global::System.Uri.EscapeDataString(managementConfigurationName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ManagementConfigurationsGetWithResult_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.MonitoringSolutions.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 ManagementConfigurationsGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ManagementConfiguration.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.CodeMessageError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.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.MonitoringSolutions.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.MonitoringSolutions.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 ManagementConfigurationsGet_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.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ManagementConfigurationPropertiesList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ManagementConfiguration.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.CodeMessageError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.CodeMessageError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -1437,31 +2320,1054 @@ public partial class MonitoringSolutions } /// - /// 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. /// /// Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription /// ID forms part of the URI for every service call. + /// The name of the resource group to get. The name is case insensitive. + /// User Management Configuration Name. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ManagementConfigurationsListBySubscription_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ManagementConfigurationsGet_Validate(string subscriptionId, string resourceGroupName, string managementConfigurationName, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(managementConfigurationName),managementConfigurationName); + } + } + + /// Retrieves the ManagementConfigurations list. + /// Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 ManagementConfigurationsListBySubscription(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) + { + var apiVersion = @"2015-11-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.OperationsManagement/ManagementConfigurations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagementConfigurationsListBySubscription_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Retrieves the ManagementConfigurations list. + /// + /// a delegate that is 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.MonitoringSolutions.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 ManagementConfigurationsListBySubscriptionViaIdentity(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.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) + { + var apiVersion = @"2015-11-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.OperationsManagement/ManagementConfigurations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.OperationsManagement/ManagementConfigurations'"); + } + + // 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.OperationsManagement/ManagementConfigurations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagementConfigurationsListBySubscription_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Retrieves the ManagementConfigurations list. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 ManagementConfigurationsListBySubscriptionViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) + { + var apiVersion = @"2015-11-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.OperationsManagement/ManagementConfigurations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.OperationsManagement/ManagementConfigurations'"); + } + + // 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.OperationsManagement/ManagementConfigurations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ManagementConfigurationsListBySubscriptionWithResult_Call (request, eventListener,sender); + } + } + + /// Retrieves the ManagementConfigurations list. + /// Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 ManagementConfigurationsListBySubscriptionWithResult(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) + { + var apiVersion = @"2015-11-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.OperationsManagement/ManagementConfigurations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ManagementConfigurationsListBySubscriptionWithResult_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.MonitoringSolutions.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 ManagementConfigurationsListBySubscriptionWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ManagementConfigurationPropertiesList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.CodeMessageError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.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.MonitoringSolutions.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.MonitoringSolutions.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 ManagementConfigurationsListBySubscription_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.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ManagementConfigurationPropertiesList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.CodeMessageError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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. + /// + /// Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagementConfigurationsListBySubscription_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + } + } + + /// Lists all of the available OperationsManagement Rest API operations. + /// 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.MonitoringSolutions.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OperationsList(global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) + { + var apiVersion = @"2015-11-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.OperationsManagement/operations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OperationsList_Call (request, onOk,eventListener,sender); + } + } + + /// Lists all of the available OperationsManagement Rest API operations. + /// + /// 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.MonitoringSolutions.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OperationsListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) + { + var apiVersion = @"2015-11-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.OperationsManagement/operations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.OperationsManagement/operations'"); + } + + // replace URI parameters with values from identity + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.OperationsManagement/operations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OperationsList_Call (request, onOk,eventListener,sender); + } + } + + /// Lists all of the available OperationsManagement Rest API operations. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OperationsListViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) + { + var apiVersion = @"2015-11-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.OperationsManagement/operations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.OperationsManagement/operations'"); + } + + // replace URI parameters with values from identity + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.OperationsManagement/operations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.OperationsListWithResult_Call (request, eventListener,sender); + } + } + + /// Lists all of the available OperationsManagement Rest API operations. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OperationsListWithResult(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) + { + var apiVersion = @"2015-11-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.OperationsManagement/operations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.OperationsListWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task OperationsListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.OperationListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.UndeclaredResponseException(_response); + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task OperationsList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.OperationListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.UndeclaredResponseException(_response); + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task OperationsList_Validate(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + + } + } + + /// update the Solution. + /// Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group to get. The name is case insensitive. + /// User Solution Name. + /// The parameters required to create OMS Solution. + /// 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.MonitoringSolutions.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 SolutionsCreateOrUpdate(string subscriptionId, string resourceGroupName, string solutionName, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolution body, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2015-11-01-preview"; + // 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.OperationsManagement/solutions/" + + global::System.Uri.EscapeDataString(solutionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SolutionsCreateOrUpdate_Call (request, onCreated,onDefault,eventListener,sender); + } + } + + /// update the Solution. + /// + /// The parameters required to create OMS Solution. + /// 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.MonitoringSolutions.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 SolutionsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolution body, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2015-11-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/(?[^/]+)/resourcegroups/(?[^/]+)/providers/Microsoft.OperationsManagement/solutions/(?[^/]+)$", 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.OperationsManagement/solutions/{solutionName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var solutionName = _match.Groups["solutionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourcegroups/" + + resourceGroupName + + "/providers/Microsoft.OperationsManagement/solutions/" + + solutionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SolutionsCreateOrUpdate_Call (request, onCreated,onDefault,eventListener,sender); + } + } + + /// update the Solution. + /// + /// The parameters required to create OMS Solution. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 SolutionsCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolution body, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2015-11-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/(?[^/]+)/resourcegroups/(?[^/]+)/providers/Microsoft.OperationsManagement/solutions/(?[^/]+)$", 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.OperationsManagement/solutions/{solutionName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var solutionName = _match.Groups["solutionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourcegroups/" + + resourceGroupName + + "/providers/Microsoft.OperationsManagement/solutions/" + + solutionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.SolutionsCreateOrUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// update the Solution. + /// Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group to get. The name is case insensitive. + /// User Solution Name. + /// Json string supplied to the SolutionsCreateOrUpdate 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.MonitoringSolutions.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 SolutionsCreateOrUpdateViaJsonString(string subscriptionId, string resourceGroupName, string solutionName, 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.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) + { + var apiVersion = @"2015-11-01-preview"; + // 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.OperationsManagement/solutions/" + + global::System.Uri.EscapeDataString(solutionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SolutionsCreateOrUpdate_Call (request, onCreated,onDefault,eventListener,sender); + } + } + + /// update the Solution. + /// Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group to get. The name is case insensitive. + /// User Solution Name. + /// Json string supplied to the SolutionsCreateOrUpdate operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 SolutionsCreateOrUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string solutionName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) + { + var apiVersion = @"2015-11-01-preview"; + // 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.OperationsManagement/solutions/" + + global::System.Uri.EscapeDataString(solutionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.SolutionsCreateOrUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// update the Solution. + /// Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group to get. The name is case insensitive. + /// User Solution Name. + /// The parameters required to create OMS Solution. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 SolutionsCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string solutionName, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolution body, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2015-11-01-preview"; + // 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.OperationsManagement/solutions/" + + global::System.Uri.EscapeDataString(solutionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.SolutionsCreateOrUpdateWithResult_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.MonitoringSolutions.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 SolutionsCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Solution.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.CodeMessageError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.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.MonitoringSolutions.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.MonitoringSolutions.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 SolutionsCreateOrUpdate_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.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Solution.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.CodeMessageError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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. + /// + /// Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group to get. The name is case insensitive. + /// User Solution Name. + /// The parameters required to create OMS Solution. + /// 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 SolutionsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string solutionName, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolution body, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(solutionName),solutionName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Lists all of the available OperationsManagement Rest API operations. + /// Deletes the solution in the subscription. + /// Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group to get. The name is case insensitive. + /// User Solution Name. /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync pipeline to use to make the request. /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task OperationsList(global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task SolutionsDelete(string subscriptionId, string resourceGroupName, string solutionName, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) { var apiVersion = @"2015-11-01-preview"; // Constant Parameters @@ -1469,7 +3375,12 @@ public partial class MonitoringSolutions { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/providers/Microsoft.OperationsManagement/operations" + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourcegroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.OperationsManagement/solutions/" + + global::System.Uri.EscapeDataString(solutionName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -1478,24 +3389,26 @@ public partial class MonitoringSolutions // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.OperationsList_Call(request,onOk,eventListener,sender); + await this.SolutionsDelete_Call (request, onOk,onDefault,eventListener,sender); } } - /// Lists all of the available OperationsManagement Rest API operations. + /// Deletes the solution in the subscription. /// /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync pipeline to use to make the request. /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task OperationsListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task SolutionsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) { var apiVersion = @"2015-11-01-preview"; // Constant Parameters @@ -1503,16 +3416,24 @@ public partial class MonitoringSolutions { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.OperationsManagement/operations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourcegroups/(?[^/]+)/providers/Microsoft.OperationsManagement/solutions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.OperationsManagement/operations'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationsManagement/solutions/{solutionName}'"); } // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var solutionName = _match.Groups["solutionName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/providers/Microsoft.OperationsManagement/operations" + "/subscriptions/" + + subscriptionId + + "/resourcegroups/" + + resourceGroupName + + "/providers/Microsoft.OperationsManagement/solutions/" + + solutionName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -1521,24 +3442,26 @@ public partial class MonitoringSolutions // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.OperationsList_Call(request,onOk,eventListener,sender); + await this.SolutionsDelete_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 + /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync pipeline to use to make the request. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task OperationsList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task SolutionsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -1549,6 +3472,7 @@ public partial class MonitoringSolutions await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -1556,12 +3480,14 @@ public partial class MonitoringSolutions case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.OperationListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response); break; } default: { - throw new Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.UndeclaredResponseException(_response); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.CodeMessageError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; } } } @@ -1576,28 +3502,36 @@ public partial class MonitoringSolutions } /// - /// Validation method for method. Call this like the actual call, but you will get validation + /// Validation method for method. Call this like the actual call, but you will get validation /// events back. /// + /// Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group to get. The name is case insensitive. + /// User Solution Name. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task OperationsList_Validate(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task SolutionsDelete_Validate(string subscriptionId, string resourceGroupName, string solutionName, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { - + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(solutionName),solutionName); } } - /// Creates or updates the Solution. + /// Retrieves the user solution. /// Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription /// ID forms part of the URI for every service call. /// The name of the resource group to get. The name is case insensitive. /// User Solution Name. - /// The parameters required to create OMS Solution. - /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is 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. @@ -1605,7 +3539,7 @@ public partial class MonitoringSolutions /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task SolutionsCreateOrUpdate(string subscriptionId, string resourceGroupName, string solutionName, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolution body, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task SolutionsGet(string subscriptionId, string resourceGroupName, string solutionName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) { var apiVersion = @"2015-11-01-preview"; // Constant Parameters @@ -1627,23 +3561,18 @@ public partial class MonitoringSolutions // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.SolutionsCreateOrUpdate_Call(request,onCreated,onDefault,eventListener,sender); + await this.SolutionsGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Creates or updates the Solution. + /// Retrieves the user solution. /// - /// The parameters required to create OMS Solution. - /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is 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. @@ -1651,7 +3580,7 @@ public partial class MonitoringSolutions /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task SolutionsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolution body, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task SolutionsGetViaIdentity(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.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) { var apiVersion = @"2015-11-01-preview"; // Constant Parameters @@ -1685,22 +3614,171 @@ public partial class MonitoringSolutions // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.SolutionsCreateOrUpdate_Call(request,onCreated,onDefault,eventListener,sender); + await this.SolutionsGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Retrieves the user solution. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 SolutionsGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) + { + var apiVersion = @"2015-11-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/(?[^/]+)/resourcegroups/(?[^/]+)/providers/Microsoft.OperationsManagement/solutions/(?[^/]+)$", 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.OperationsManagement/solutions/{solutionName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var solutionName = _match.Groups["solutionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourcegroups/" + + resourceGroupName + + "/providers/Microsoft.OperationsManagement/solutions/" + + solutionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.SolutionsGetWithResult_Call (request, eventListener,sender); + } + } + + /// Retrieves the user solution. + /// Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group to get. The name is case insensitive. + /// User Solution Name. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 SolutionsGetWithResult(string subscriptionId, string resourceGroupName, string solutionName, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) + { + var apiVersion = @"2015-11-01-preview"; + // 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.OperationsManagement/solutions/" + + global::System.Uri.EscapeDataString(solutionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.SolutionsGetWithResult_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.MonitoringSolutions.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 SolutionsGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Solution.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.CodeMessageError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.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.MonitoringSolutions.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. @@ -1708,7 +3786,7 @@ public partial class MonitoringSolutions /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task SolutionsCreateOrUpdate_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.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task SolutionsGet_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.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -1719,20 +3797,21 @@ public partial class MonitoringSolutions await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.Solution.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Solution.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.CodeMessageError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.CodeMessageError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -1748,19 +3827,18 @@ public partial class MonitoringSolutions } /// - /// 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. /// /// Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription /// ID forms part of the URI for every service call. /// The name of the resource group to get. The name is case insensitive. /// User Solution Name. - /// The parameters required to create OMS Solution. /// 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 SolutionsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string solutionName, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolution body, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task SolutionsGet_Validate(string subscriptionId, string resourceGroupName, string solutionName, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -1768,18 +3846,17 @@ public partial class MonitoringSolutions await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); await eventListener.AssertNotNull(nameof(solutionName),solutionName); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Deletes the solution in the subscription. + /// + /// Retrieves the solution list. It will retrieve both first party and third party solutions + /// /// Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription /// ID forms part of the URI for every service call. /// The name of the resource group to get. The name is case insensitive. - /// User Solution Name. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -1788,20 +3865,72 @@ public partial class MonitoringSolutions /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task SolutionsDelete(string subscriptionId, string resourceGroupName, string solutionName, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task SolutionsListByResourceGroup(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.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) + { + var apiVersion = @"2015-11-01-preview"; + // 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.OperationsManagement/solutions" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SolutionsListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Retrieves the solution list. It will retrieve both first party and third party solutions + /// + /// + /// a delegate that is 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.MonitoringSolutions.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 SolutionsListByResourceGroupViaIdentity(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.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) { var apiVersion = @"2015-11-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/(?[^/]+)/resourcegroups/(?[^/]+)/providers/Microsoft.OperationsManagement/solutions$", 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.OperationsManagement/solutions'"); + } + + // 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/" - + global::System.Uri.EscapeDataString(subscriptionId) + + subscriptionId + "/resourcegroups/" - + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.OperationsManagement/solutions/" - + global::System.Uri.EscapeDataString(solutionName) + + resourceGroupName + + "/providers/Microsoft.OperationsManagement/solutions" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -1810,26 +3939,26 @@ public partial class MonitoringSolutions // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.SolutionsDelete_Call(request,onOk,onDefault,eventListener,sender); + await this.SolutionsListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); } } - /// Deletes the solution in the subscription. + /// + /// Retrieves the solution list. It will retrieve both first party and third party solutions + /// /// - /// a delegate that is 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.MonitoringSolutions.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 SolutionsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task SolutionsListByResourceGroupViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) { var apiVersion = @"2015-11-01-preview"; // Constant Parameters @@ -1837,42 +3966,144 @@ public partial class MonitoringSolutions { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourcegroups/(?[^/]+)/providers/Microsoft.OperationsManagement/solutions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourcegroups/(?[^/]+)/providers/Microsoft.OperationsManagement/solutions$", 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.OperationsManagement/solutions/{solutionName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationsManagement/solutions'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var solutionName = _match.Groups["solutionName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourcegroups/" + resourceGroupName - + "/providers/Microsoft.OperationsManagement/solutions/" - + solutionName + + "/providers/Microsoft.OperationsManagement/solutions" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Method.Delete, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.SolutionsListByResourceGroupWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Retrieves the solution list. It will retrieve both first party and third party solutions + /// + /// Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group to get. The name is case insensitive. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 SolutionsListByResourceGroupWithResult(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) + { + var apiVersion = @"2015-11-01-preview"; + // 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.OperationsManagement/solutions" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.SolutionsDelete_Call(request,onOk,onDefault,eventListener,sender); + return await this.SolutionsListByResourceGroupWithResult_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.MonitoringSolutions.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 SolutionsListByResourceGroupWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.SolutionPropertiesList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.CodeMessageError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.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.MonitoringSolutions.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 @@ -1882,7 +4113,7 @@ public partial class MonitoringSolutions /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task SolutionsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task SolutionsListByResourceGroup_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.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -1893,6 +4124,7 @@ public partial class MonitoringSolutions await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -1900,13 +4132,13 @@ public partial class MonitoringSolutions case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.SolutionPropertiesList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.CodeMessageError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.CodeMessageError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -1922,18 +4154,17 @@ public partial class MonitoringSolutions } /// - /// 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. /// /// Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription /// ID forms part of the URI for every service call. /// The name of the resource group to get. The name is case insensitive. - /// User Solution Name. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task SolutionsDelete_Validate(string subscriptionId, string resourceGroupName, string solutionName, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task SolutionsListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -1941,16 +4172,15 @@ public partial class MonitoringSolutions await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); - await eventListener.AssertNotNull(nameof(solutionName),solutionName); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); } } - /// Retrieves the user solution. + /// + /// Retrieves the solution list. It will retrieve both first party and third party solutions + /// /// Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription /// ID forms part of the URI for every service call. - /// The name of the resource group to get. The name is case insensitive. - /// User Solution Name. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -1959,7 +4189,7 @@ public partial class MonitoringSolutions /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task SolutionsGet(string subscriptionId, string resourceGroupName, string solutionName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task SolutionsListBySubscription(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) { var apiVersion = @"2015-11-01-preview"; // Constant Parameters @@ -1969,10 +4199,7 @@ public partial class MonitoringSolutions var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + global::System.Uri.EscapeDataString(subscriptionId) - + "/resourcegroups/" - + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.OperationsManagement/solutions/" - + global::System.Uri.EscapeDataString(solutionName) + + "/providers/Microsoft.OperationsManagement/solutions" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -1986,11 +4213,13 @@ public partial class MonitoringSolutions await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.SolutionsGet_Call(request,onOk,onDefault,eventListener,sender); + await this.SolutionsListBySubscription_Call (request, onOk,onDefault,eventListener,sender); } } - /// Retrieves the user solution. + /// + /// Retrieves the solution list. It will retrieve both first party and third party solutions + /// /// /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -2000,7 +4229,7 @@ public partial class MonitoringSolutions /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task SolutionsGetViaIdentity(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.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task SolutionsListBySubscriptionViaIdentity(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.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) { var apiVersion = @"2015-11-01-preview"; // Constant Parameters @@ -2008,24 +4237,19 @@ public partial class MonitoringSolutions { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourcegroups/(?[^/]+)/providers/Microsoft.OperationsManagement/solutions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.OperationsManagement/solutions$", 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.OperationsManagement/solutions/{solutionName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.OperationsManagement/solutions'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var solutionName = _match.Groups["solutionName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId - + "/resourcegroups/" - + resourceGroupName - + "/providers/Microsoft.OperationsManagement/solutions/" - + solutionName + + "/providers/Microsoft.OperationsManagement/solutions" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -2039,81 +4263,55 @@ public partial class MonitoringSolutions await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.SolutionsGet_Call(request,onOk,onDefault,eventListener,sender); + await this.SolutionsListBySubscription_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). + /// + /// Retrieves the solution list. It will retrieve both first party and third party solutions + /// + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 SolutionsGet_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.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task SolutionsListBySubscriptionViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) { + var apiVersion = @"2015-11-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.MonitoringSolutions.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.Solution.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.CodeMessageError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.OperationsManagement/solutions$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.OperationsManagement/solutions'"); } - } - } - /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. - /// - /// Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription - /// ID forms part of the URI for every service call. - /// The name of the resource group to get. The name is case insensitive. - /// User Solution Name. - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task SolutionsGet_Validate(string subscriptionId, string resourceGroupName, string solutionName, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); - await eventListener.AssertNotNull(nameof(solutionName),solutionName); + // 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.OperationsManagement/solutions" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.SolutionsListBySubscriptionWithResult_Call (request, eventListener,sender); } } @@ -2122,16 +4320,13 @@ public partial class MonitoringSolutions /// /// Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription /// ID forms part of the URI for every service call. - /// The name of the resource group to get. 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.MonitoringSolutions.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 SolutionsListByResourceGroup(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.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task SolutionsListBySubscriptionWithResult(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) { var apiVersion = @"2015-11-01-preview"; // Constant Parameters @@ -2141,80 +4336,87 @@ public partial class MonitoringSolutions var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + global::System.Uri.EscapeDataString(subscriptionId) - + "/resourcegroups/" - + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.OperationsManagement/solutions" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.SolutionsListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + return await this.SolutionsListBySubscriptionWithResult_Call (request, eventListener,sender); } } /// - /// Retrieves the solution list. It will retrieve both first party and third party solutions + /// Actual wire call for method. /// - /// - /// a delegate that is 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 prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 SolutionsListByResourceGroupViaIdentity(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.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task SolutionsListBySubscriptionWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) { - var apiVersion = @"2015-11-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.MonitoringSolutions.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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("^/subscriptions/(?[^/]+)/resourcegroups/(?[^/]+)/providers/Microsoft.OperationsManagement/solutions$", 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.MonitoringSolutions.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.SolutionPropertiesList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.CodeMessageError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.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 '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationsManagement/solutions'"); + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); } - - // 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.OperationsManagement/solutions" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.SolutionsListByResourceGroup_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 @@ -2224,7 +4426,7 @@ public partial class MonitoringSolutions /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task SolutionsListByResourceGroup_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.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task SolutionsListBySubscription_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.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -2235,6 +4437,7 @@ public partial class MonitoringSolutions await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -2242,13 +4445,13 @@ public partial class MonitoringSolutions case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.SolutionPropertiesList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.SolutionPropertiesList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.CodeMessageError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.CodeMessageError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -2264,42 +4467,39 @@ public partial class MonitoringSolutions } /// - /// Validation method for method. Call this like the actual call, but you will + /// Validation method for method. Call this like the actual call, but you will /// get validation events back. /// /// Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription /// ID forms part of the URI for every service call. - /// The name of the resource group to get. 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 SolutionsListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task SolutionsListBySubscription_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); } } - /// - /// Retrieves the solution list. It will retrieve both first party and third party solutions - /// + /// update the tags of a solution. /// Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription /// ID forms part of the URI for every service call. + /// The name of the resource group to get. The name is case insensitive. + /// User Solution Name. + /// The parameters required to patch a Solution. /// a delegate that is 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.MonitoringSolutions.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 SolutionsListBySubscription(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task SolutionsUpdate(string subscriptionId, string resourceGroupName, string solutionName, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPatch body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2015-11-01-preview"; // Constant Parameters @@ -2309,7 +4509,10 @@ public partial class MonitoringSolutions var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + global::System.Uri.EscapeDataString(subscriptionId) - + "/providers/Microsoft.OperationsManagement/solutions" + + "/resourcegroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.OperationsManagement/solutions/" + + global::System.Uri.EscapeDataString(solutionName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -2318,28 +4521,32 @@ public partial class MonitoringSolutions // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.SolutionsListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + await this.SolutionsUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// - /// Retrieves the solution list. It will retrieve both first party and third party solutions - /// + /// update the tags of a solution. /// + /// The parameters required to patch a Solution. /// a delegate that is 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.MonitoringSolutions.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 SolutionsListBySubscriptionViaIdentity(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.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task SolutionsUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPatch body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2015-11-01-preview"; // Constant Parameters @@ -2347,19 +4554,24 @@ public partial class MonitoringSolutions { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.OperationsManagement/solutions$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourcegroups/(?[^/]+)/providers/Microsoft.OperationsManagement/solutions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.OperationsManagement/solutions'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationsManagement/solutions/{solutionName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var solutionName = _match.Groups["solutionName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId - + "/providers/Microsoft.OperationsManagement/solutions" + + "/resourcegroups/" + + resourceGroupName + + "/providers/Microsoft.OperationsManagement/solutions/" + + solutionName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -2368,97 +4580,138 @@ public partial class MonitoringSolutions // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.SolutionsListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + await this.SolutionsUpdate_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 the tags of a solution. + /// + /// The parameters required to patch a Solution. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 SolutionsListBySubscription_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.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task SolutionsUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPatch body, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2015-11-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.MonitoringSolutions.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.SolutionPropertiesList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.CodeMessageError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourcegroups/(?[^/]+)/providers/Microsoft.OperationsManagement/solutions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationsManagement/solutions/{solutionName}'"); } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var solutionName = _match.Groups["solutionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourcegroups/" + + resourceGroupName + + "/providers/Microsoft.OperationsManagement/solutions/" + + solutionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.SolutionsUpdateWithResult_Call (request, eventListener,sender); } } - /// - /// Validation method for method. Call this like the actual call, but you will - /// get validation events back. - /// + /// update the tags of a solution. /// Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription /// ID forms part of the URI for every service call. + /// The name of the resource group to get. The name is case insensitive. + /// User Solution Name. + /// Json string supplied to the SolutionsUpdate 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.MonitoringSolutions.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 SolutionsListBySubscription_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener) + public async global::System.Threading.Tasks.Task SolutionsUpdateViaJsonString(string subscriptionId, string resourceGroupName, string solutionName, 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.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) { + var apiVersion = @"2015-11-01-preview"; + // Constant Parameters using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourcegroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.OperationsManagement/solutions/" + + global::System.Uri.EscapeDataString(solutionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SolutionsUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Update the tags of a solution. + /// update the tags of a solution. /// Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription /// ID forms part of the URI for every service call. /// The name of the resource group to get. The name is case insensitive. /// User Solution Name. - /// The parameters required to patch a Solution. - /// a delegate that is 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 SolutionsUpdate operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 SolutionsUpdate(string subscriptionId, string resourceGroupName, string solutionName, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPatch body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task SolutionsUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string solutionName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) { var apiVersion = @"2015-11-01-preview"; // Constant Parameters @@ -2476,82 +4729,132 @@ public partial class MonitoringSolutions + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.SolutionsUpdate_Call(request,onOk,onDefault,eventListener,sender); + return await this.SolutionsUpdateWithResult_Call (request, eventListener,sender); } } - /// Update the tags of a solution. - /// + /// update the tags of a solution. + /// Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group to get. The name is case insensitive. + /// User Solution Name. /// The parameters required to patch a Solution. - /// a delegate that is 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.MonitoringSolutions.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 SolutionsUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPatch body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task SolutionsUpdateWithResult(string subscriptionId, string resourceGroupName, string solutionName, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPatch body, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2015-11-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/(?[^/]+)/resourcegroups/(?[^/]+)/providers/Microsoft.OperationsManagement/solutions/(?[^/]+)$", 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.OperationsManagement/solutions/{solutionName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var solutionName = _match.Groups["solutionName"].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.OperationsManagement/solutions/" - + solutionName + + global::System.Uri.EscapeDataString(solutionName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.SolutionsUpdate_Call(request,onOk,onDefault,eventListener,sender); + return await this.SolutionsUpdateWithResult_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.MonitoringSolutions.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 SolutionsUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Solution.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.CodeMessageError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.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.MonitoringSolutions.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 @@ -2561,7 +4864,7 @@ public partial class MonitoringSolutions /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task SolutionsUpdate_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.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task SolutionsUpdate_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.MonitoringSolutions.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -2572,6 +4875,7 @@ public partial class MonitoringSolutions await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -2579,13 +4883,13 @@ public partial class MonitoringSolutions case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.Solution.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Solution.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.CodeMessageError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.CodeMessageError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -2613,7 +4917,7 @@ public partial class MonitoringSolutions /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task SolutionsUpdate_Validate(string subscriptionId, string resourceGroupName, string solutionName, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPatch body, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task SolutionsUpdate_Validate(string subscriptionId, string resourceGroupName, string solutionName, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPatch body, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -2621,7 +4925,7 @@ public partial class MonitoringSolutions await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); await eventListener.AssertNotNull(nameof(solutionName),solutionName); await eventListener.AssertNotNull(nameof(body), body); await eventListener.AssertObjectIsValid(nameof(body), body); diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/cmdlets/GetAzMonitorLogAnalyticsOperation_List.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/cmdlets/GetAzMonitorLogAnalyticsOperation_List.cs index 91d80f453596..a6bd6fc29c68 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/cmdlets/GetAzMonitorLogAnalyticsOperation_List.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/cmdlets/GetAzMonitorLogAnalyticsOperation_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Cmdlets; using System; /// Lists all of the available OperationsManagement Rest API operations. @@ -14,12 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzMonitorLogAnalyticsOperation_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperation))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperation))] [global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Description(@"Lists all of the available OperationsManagement Rest API operations.")] [global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.HttpPath(Path = "/providers/Microsoft.OperationsManagement/operations", ApiVersion = "2015-11-01-preview")] public partial class GetAzMonitorLogAnalyticsOperation_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 GetAzMonitorLogAnalyticsOperation_List : global::System.Man /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first 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.MonitoringSolutions.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.MonitoringSolutions Client => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Module.Instance.ClientAPI; @@ -53,6 +71,9 @@ public partial class GetAzMonitorLogAnalyticsOperation_List : global::System.Man [global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 GetAzMonitorLogAnalyticsOperation_List : global::System.Man /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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")] @@ -102,12 +123,12 @@ public partial class GetAzMonitorLogAnalyticsOperation_List : global::System.Man /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperationListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationListResult /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -130,6 +151,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.MonitoringSolutions.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -151,7 +177,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzMonitorLogAnalyticsOperation_List() { @@ -202,8 +228,33 @@ public GetAzMonitorLogAnalyticsOperation_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.MonitoringSolutions.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.MonitoringSolutions.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -256,7 +307,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -274,7 +325,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 } }); @@ -310,12 +361,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.MonitoringSolutions.Models.Api20151101Preview.IOperationListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationListResult /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -327,9 +378,33 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperationListResult + 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/MonitoringSolutions/MonitoringSolutions.Autorest/generated/cmdlets/GetAzMonitorLogAnalyticsSolution_Get.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/cmdlets/GetAzMonitorLogAnalyticsSolution_Get.cs index e27bbcfae92d..75bdd774561d 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/cmdlets/GetAzMonitorLogAnalyticsSolution_Get.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/cmdlets/GetAzMonitorLogAnalyticsSolution_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Cmdlets; using System; /// Retrieves the user solution. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationsManagement/solutions/{solutionName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzMonitorLogAnalyticsSolution_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolution))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolution))] [global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Description(@"Retrieves the user solution.")] [global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.HttpPath(Path = "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationsManagement/solutions/{solutionName}", ApiVersion = "2015-11-01-preview")] public partial class GetAzMonitorLogAnalyticsSolution_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 GetAzMonitorLogAnalyticsSolution_Get : 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.MonitoringSolutions.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.MonitoringSolutions Client => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class GetAzMonitorLogAnalyticsSolution_Get : global::System.Manag [global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 GetAzMonitorLogAnalyticsSolution_Get : global::System.Manag /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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")] @@ -142,7 +163,8 @@ public partial class GetAzMonitorLogAnalyticsSolution_Get : global::System.Manag [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -151,24 +173,24 @@ public partial class GetAzMonitorLogAnalyticsSolution_Get : 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.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageError /// 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.MonitoringSolutions.Models.Api20151101Preview.ISolution + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolution /// 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) @@ -191,6 +213,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.MonitoringSolutions.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -212,7 +239,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzMonitorLogAnalyticsSolution_Get() { @@ -263,8 +290,33 @@ public GetAzMonitorLogAnalyticsSolution_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.MonitoringSolutions.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.MonitoringSolutions.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -317,7 +369,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -338,7 +390,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 } }); @@ -376,12 +428,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.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageError /// 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 ) { @@ -398,15 +450,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.MonitoringSolutions.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.MonitoringSolutions.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 } }); @@ -416,12 +468,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.MonitoringSolutions.Models.Api20151101Preview.ISolution + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolution /// 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 ) { @@ -433,8 +485,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolution - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolution + 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/MonitoringSolutions/MonitoringSolutions.Autorest/generated/cmdlets/GetAzMonitorLogAnalyticsSolution_GetViaIdentity.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/cmdlets/GetAzMonitorLogAnalyticsSolution_GetViaIdentity.cs index 8c921946b674..31cae35d142b 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/cmdlets/GetAzMonitorLogAnalyticsSolution_GetViaIdentity.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/cmdlets/GetAzMonitorLogAnalyticsSolution_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Cmdlets; using System; /// Retrieves the user solution. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationsManagement/solutions/{solutionName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzMonitorLogAnalyticsSolution_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolution))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolution))] [global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Description(@"Retrieves the user solution.")] [global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.HttpPath(Path = "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationsManagement/solutions/{solutionName}", ApiVersion = "2015-11-01-preview")] public partial class GetAzMonitorLogAnalyticsSolution_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 GetAzMonitorLogAnalyticsSolution_GetViaIdentity : global::S /// 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.MonitoringSolutions.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.MonitoringSolutions Client => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class GetAzMonitorLogAnalyticsSolution_GetViaIdentity : global::S [global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 GetAzMonitorLogAnalyticsSolution_GetViaIdentity : global::S /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 GetAzMonitorLogAnalyticsSolution_GetViaIdentity : global::S /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageError /// 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.MonitoringSolutions.Models.Api20151101Preview.ISolution + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolution /// 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.MonitoringSolutions.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 GetAzMonitorLogAnalyticsSolution_GetViaIdentity() { @@ -221,8 +247,33 @@ public GetAzMonitorLogAnalyticsSolution_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.MonitoringSolutions.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.MonitoringSolutions.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -313,7 +364,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -351,12 +402,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageError /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -373,7 +424,7 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.RestException(responseMessage, await response); WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } @@ -391,12 +442,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolution + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolution /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -408,8 +459,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolution - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolution + 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/MonitoringSolutions/MonitoringSolutions.Autorest/generated/cmdlets/GetAzMonitorLogAnalyticsSolution_List.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/cmdlets/GetAzMonitorLogAnalyticsSolution_List.cs index 01923c96d715..a14d528db46c 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/cmdlets/GetAzMonitorLogAnalyticsSolution_List.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/cmdlets/GetAzMonitorLogAnalyticsSolution_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Cmdlets; using System; /// @@ -15,12 +17,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Cmdlets /// [OpenAPI] ListByResourceGroup=>GET:"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationsManagement/solutions" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzMonitorLogAnalyticsSolution_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolution))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPropertiesList))] [global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Description(@"Retrieves the solution list. It will retrieve both first party and third party solutions")] [global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.HttpPath(Path = "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationsManagement/solutions", ApiVersion = "2015-11-01-preview")] public partial class GetAzMonitorLogAnalyticsSolution_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -36,11 +39,26 @@ public partial class GetAzMonitorLogAnalyticsSolution_List : global::System.Mana /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first 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.MonitoringSolutions.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.MonitoringSolutions Client => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Module.Instance.ClientAPI; @@ -54,6 +72,9 @@ public partial class GetAzMonitorLogAnalyticsSolution_List : global::System.Mana [global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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] @@ -80,7 +101,7 @@ public partial class GetAzMonitorLogAnalyticsSolution_List : global::System.Mana /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -129,7 +150,8 @@ public partial class GetAzMonitorLogAnalyticsSolution_List : global::System.Mana [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -138,24 +160,24 @@ public partial class GetAzMonitorLogAnalyticsSolution_List : global::System.Mana /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageError /// 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.MonitoringSolutions.Models.Api20151101Preview.ISolutionPropertiesList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPropertiesList /// 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) @@ -178,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.MonitoringSolutions.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -199,7 +226,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzMonitorLogAnalyticsSolution_List() { @@ -250,8 +277,33 @@ public GetAzMonitorLogAnalyticsSolution_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.MonitoringSolutions.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.MonitoringSolutions.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -304,7 +356,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -325,7 +377,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 } }); @@ -363,12 +415,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.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageError /// 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 +437,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.MonitoringSolutions.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.MonitoringSolutions.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 } }); @@ -403,12 +455,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.MonitoringSolutions.Models.Api20151101Preview.ISolutionPropertiesList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPropertiesList /// 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,9 +472,33 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPropertiesList + var result = (await response); // response should be returning an array of some kind. +Pageable // nested-array / 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/MonitoringSolutions/MonitoringSolutions.Autorest/generated/cmdlets/GetAzMonitorLogAnalyticsSolution_List1.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/cmdlets/GetAzMonitorLogAnalyticsSolution_List1.cs index 3f72ecaaaf1d..92625fdf865d 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/cmdlets/GetAzMonitorLogAnalyticsSolution_List1.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/cmdlets/GetAzMonitorLogAnalyticsSolution_List1.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Cmdlets; using System; /// @@ -15,12 +17,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Cmdlets /// [OpenAPI] ListBySubscription=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.OperationsManagement/solutions" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzMonitorLogAnalyticsSolution_List1")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolution))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPropertiesList))] [global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Description(@"Retrieves the solution list. It will retrieve both first party and third party solutions")] [global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.OperationsManagement/solutions", ApiVersion = "2015-11-01-preview")] public partial class GetAzMonitorLogAnalyticsSolution_List1 : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -36,11 +39,26 @@ public partial class GetAzMonitorLogAnalyticsSolution_List1 : 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.MonitoringSolutions.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.MonitoringSolutions Client => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Module.Instance.ClientAPI; @@ -54,6 +72,9 @@ public partial class GetAzMonitorLogAnalyticsSolution_List1 : global::System.Man [global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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] @@ -80,7 +101,7 @@ public partial class GetAzMonitorLogAnalyticsSolution_List1 : global::System.Man /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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")] @@ -115,7 +136,8 @@ public partial class GetAzMonitorLogAnalyticsSolution_List1 : global::System.Man [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -124,24 +146,24 @@ public partial class GetAzMonitorLogAnalyticsSolution_List1 : 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.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageError /// 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.MonitoringSolutions.Models.Api20151101Preview.ISolutionPropertiesList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPropertiesList /// 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) @@ -164,6 +186,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -185,7 +212,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzMonitorLogAnalyticsSolution_List1() { @@ -236,8 +263,33 @@ public GetAzMonitorLogAnalyticsSolution_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.MonitoringSolutions.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.MonitoringSolutions.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -290,7 +342,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -311,7 +363,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 } }); @@ -349,12 +401,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.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageError /// 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 ) { @@ -371,15 +423,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.MonitoringSolutions.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.MonitoringSolutions.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 } }); @@ -389,12 +441,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.MonitoringSolutions.Models.Api20151101Preview.ISolutionPropertiesList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPropertiesList /// 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 ) { @@ -406,9 +458,33 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPropertiesList + var result = (await response); // response should be returning an array of some kind. +Pageable // nested-array / 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/MonitoringSolutions/MonitoringSolutions.Autorest/generated/cmdlets/NewAzMonitorLogAnalyticsSolution_CreateExpanded.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/cmdlets/NewAzMonitorLogAnalyticsSolution_CreateExpanded.cs index e1883d45e343..640b517f60db 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/cmdlets/NewAzMonitorLogAnalyticsSolution_CreateExpanded.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/cmdlets/NewAzMonitorLogAnalyticsSolution_CreateExpanded.cs @@ -6,20 +6,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Cmdlets; using System; - /// Creates or updates the Solution. + /// create the Solution. /// /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationsManagement/solutions/{solutionName}" /// [global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzMonitorLogAnalyticsSolution_CreateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolution))] - [global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Description(@"Creates or updates the Solution.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolution))] + [global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Description(@"create the Solution.")] [global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.HttpPath(Path = "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationsManagement/solutions/{solutionName}", ApiVersion = "2015-11-01-preview")] public partial class NewAzMonitorLogAnalyticsSolution_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 NewAzMonitorLogAnalyticsSolution_CreateExpanded : global::S /// 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 container for solution. - private Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolution _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.Solution(); + private Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolution _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Solution(); + + /// + /// 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.MonitoringSolutions.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.MonitoringSolutions Client => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Module.Instance.ClientAPI; @@ -59,7 +77,7 @@ public partial class NewAzMonitorLogAnalyticsSolution_CreateExpanded : global::S Description = @"The azure resources that will be contained within the solutions. They will be locked and gets deleted automatically when the solution is deleted.", SerializedName = @"containedResources", PossibleTypes = new [] { typeof(string) })] - public string[] ContainedResource { get => _parametersBody.ContainedResource ?? null /* arrayOf */; set => _parametersBody.ContainedResource = value; } + public string[] ContainedResource { get => _parametersBody.ContainedResource?.ToArray() ?? null /* fixedArrayOf */; set => _parametersBody.ContainedResource = (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 @@ -71,6 +89,9 @@ public partial class NewAzMonitorLogAnalyticsSolution_CreateExpanded : global::S [global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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] @@ -123,7 +144,7 @@ public partial class NewAzMonitorLogAnalyticsSolution_CreateExpanded : global::S /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.HttpPipeline Pipeline { get; set; } /// /// name of the solution to be created. For Microsoft published solution it should be in the format of solutionType(workspaceName). @@ -203,7 +224,7 @@ public partial class NewAzMonitorLogAnalyticsSolution_CreateExpanded : global::S Description = @"The resources that will be referenced from this solution. Deleting any of those solution out of band will break the solution.", SerializedName = @"referencedResources", PossibleTypes = new [] { typeof(string) })] - public string[] ReferencedResource { get => _parametersBody.ReferencedResource ?? null /* arrayOf */; set => _parametersBody.ReferencedResource = value; } + public string[] ReferencedResource { get => _parametersBody.ReferencedResource?.ToArray() ?? null /* fixedArrayOf */; set => _parametersBody.ReferencedResource = (value != null ? new System.Collections.Generic.List(value) : null); } /// Backing field for property. private string _resourceGroupName; @@ -236,7 +257,8 @@ public partial class NewAzMonitorLogAnalyticsSolution_CreateExpanded : global::S [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -249,8 +271,8 @@ public partial class NewAzMonitorLogAnalyticsSolution_CreateExpanded : global::S ReadOnly = false, Description = @"Resource tags", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionTags Tag { get => _parametersBody.Tag ?? null /* object */; set => _parametersBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionTags Tag { get => _parametersBody.Tag ?? null /* object */; set => _parametersBody.Tag = value; } /// /// The azure resourceId for the workspace where the solution will be deployed/enabled. @@ -270,24 +292,24 @@ public partial class NewAzMonitorLogAnalyticsSolution_CreateExpanded : global::S /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolution + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolution /// 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.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageError /// 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) @@ -310,6 +332,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.MonitoringSolutions.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -374,8 +401,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.MonitoringSolutions.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.MonitoringSolutions.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -385,7 +437,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzMonitorLogAnalyticsSolution_CreateExpanded() { @@ -439,7 +491,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -452,12 +504,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.SolutionsCreateOrUpdate(SubscriptionId, ResourceGroupName, Name, _parametersBody, onCreated, onDefault, this, Pipeline); + await this.Client.SolutionsCreateOrUpdate(SubscriptionId, ResourceGroupName, Name, _parametersBody, onCreated, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode.IncludeCreate); await ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 } }); @@ -493,12 +545,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.MonitoringSolutions.Models.Api20151101Preview.ISolution + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolution /// 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 ) { @@ -510,8 +562,26 @@ protected override void StopProcessing() return ; } // onCreated - response for 201 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolution - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolution + 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; + } + } } } @@ -519,12 +589,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.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageError /// 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 ) { @@ -541,15 +611,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.MonitoringSolutions.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.MonitoringSolutions.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 } }); diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/cmdlets/RemoveAzMonitorLogAnalyticsSolution_Delete.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/cmdlets/RemoveAzMonitorLogAnalyticsSolution_Delete.cs index 6aa8222911b7..73486d96d7c9 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/cmdlets/RemoveAzMonitorLogAnalyticsSolution_Delete.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/cmdlets/RemoveAzMonitorLogAnalyticsSolution_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Cmdlets; using System; /// Deletes the solution in the subscription. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.HttpPath(Path = "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationsManagement/solutions/{solutionName}", ApiVersion = "2015-11-01-preview")] public partial class RemoveAzMonitorLogAnalyticsSolution_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 RemoveAzMonitorLogAnalyticsSolution_Delete : 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.MonitoringSolutions.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.MonitoringSolutions Client => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class RemoveAzMonitorLogAnalyticsSolution_Delete : global::System [global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 RemoveAzMonitorLogAnalyticsSolution_Delete : global::System /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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")] @@ -149,7 +170,8 @@ public partial class RemoveAzMonitorLogAnalyticsSolution_Delete : global::System [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -158,12 +180,12 @@ public partial class RemoveAzMonitorLogAnalyticsSolution_Delete : 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.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageError /// 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 @@ -196,6 +218,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.MonitoringSolutions.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -260,8 +287,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.MonitoringSolutions.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.MonitoringSolutions.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -317,7 +369,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -335,7 +387,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 } }); @@ -348,7 +400,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzMonitorLogAnalyticsSolution_Delete() { @@ -381,12 +433,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageError /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -403,15 +455,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/cmdlets/RemoveAzMonitorLogAnalyticsSolution_DeleteViaIdentity.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/cmdlets/RemoveAzMonitorLogAnalyticsSolution_DeleteViaIdentity.cs index 5e04a0afc4c0..d5b6dc4aa769 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/cmdlets/RemoveAzMonitorLogAnalyticsSolution_DeleteViaIdentity.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/cmdlets/RemoveAzMonitorLogAnalyticsSolution_DeleteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Cmdlets; using System; /// Deletes the solution in the subscription. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.HttpPath(Path = "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationsManagement/solutions/{solutionName}", ApiVersion = "2015-11-01-preview")] public partial class RemoveAzMonitorLogAnalyticsSolution_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 RemoveAzMonitorLogAnalyticsSolution_DeleteViaIdentity : 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.MonitoringSolutions.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.MonitoringSolutions Client => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class RemoveAzMonitorLogAnalyticsSolution_DeleteViaIdentity : glo [global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 RemoveAzMonitorLogAnalyticsSolution_DeleteViaIdentity : glo /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 RemoveAzMonitorLogAnalyticsSolution_DeleteViaIdentity : 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.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageError /// 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.MonitoringSolutions.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.MonitoringSolutions.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.MonitoringSolutions.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -313,7 +364,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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,7 +377,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzMonitorLogAnalyticsSolution_DeleteViaIdentity() { @@ -359,12 +410,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.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageError /// 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,7 +432,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.MonitoringSolutions.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.RestException(responseMessage, await response); WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/cmdlets/UpdateAzMonitorLogAnalyticsSolution_UpdateExpanded.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/cmdlets/UpdateAzMonitorLogAnalyticsSolution_UpdateExpanded.cs index d26d0d103cdd..11fedcd35277 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/cmdlets/UpdateAzMonitorLogAnalyticsSolution_UpdateExpanded.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/cmdlets/UpdateAzMonitorLogAnalyticsSolution_UpdateExpanded.cs @@ -6,19 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Cmdlets; using System; - /// Update the tags of a solution. + /// update the tags of a solution. /// /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationsManagement/solutions/{solutionName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzMonitorLogAnalyticsSolution_UpdateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolution))] - [global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Description(@"Update the tags of a solution.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolution))] + [global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Description(@"update the tags of a solution.")] [global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.HttpPath(Path = "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationsManagement/solutions/{solutionName}", ApiVersion = "2015-11-01-preview")] public partial class UpdateAzMonitorLogAnalyticsSolution_UpdateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 UpdateAzMonitorLogAnalyticsSolution_UpdateExpanded : 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 properties of a Solution that can be patched. - private Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPatch _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.SolutionPatch(); + private Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPatch _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.SolutionPatch(); + + /// + /// 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.MonitoringSolutions.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.MonitoringSolutions Client => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Module.Instance.ClientAPI; @@ -55,6 +73,9 @@ public partial class UpdateAzMonitorLogAnalyticsSolution_UpdateExpanded : global [global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 UpdateAzMonitorLogAnalyticsSolution_UpdateExpanded : global /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 UpdateAzMonitorLogAnalyticsSolution_UpdateExpanded : global [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -158,32 +180,32 @@ public partial class UpdateAzMonitorLogAnalyticsSolution_UpdateExpanded : global ReadOnly = false, Description = @"Resource tags", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPatchTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPatchTags Tag { get => _parametersBody.Tag ?? null /* object */; set => _parametersBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPatchTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPatchTags Tag { get => _parametersBody.Tag ?? null /* object */; set => _parametersBody.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.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageError /// 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.MonitoringSolutions.Models.Api20151101Preview.ISolution + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolution /// 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) @@ -206,6 +228,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.MonitoringSolutions.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -270,8 +297,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.MonitoringSolutions.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.MonitoringSolutions.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -327,7 +379,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -340,12 +392,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.SolutionsUpdate(SubscriptionId, ResourceGroupName, Name, _parametersBody, onOk, onDefault, this, Pipeline); + await this.Client.SolutionsUpdate(SubscriptionId, ResourceGroupName, Name, _parametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode.IncludeUpdate); await ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 } }); @@ -365,7 +417,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzMonitorLogAnalyticsSolution_UpdateExpanded() { @@ -391,12 +443,12 @@ public UpdateAzMonitorLogAnalyticsSolution_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.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageError /// 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 ) { @@ -413,15 +465,15 @@ public UpdateAzMonitorLogAnalyticsSolution_UpdateExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.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 } }); @@ -431,12 +483,12 @@ public UpdateAzMonitorLogAnalyticsSolution_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.MonitoringSolutions.Models.Api20151101Preview.ISolution + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolution /// 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 ) { @@ -448,8 +500,26 @@ public UpdateAzMonitorLogAnalyticsSolution_UpdateExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolution - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolution + 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/MonitoringSolutions/MonitoringSolutions.Autorest/generated/cmdlets/UpdateAzMonitorLogAnalyticsSolution_UpdateViaIdentityExpanded.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/cmdlets/UpdateAzMonitorLogAnalyticsSolution_UpdateViaIdentityExpanded.cs index 724f0b3e5a9c..58f8682b9eb1 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/cmdlets/UpdateAzMonitorLogAnalyticsSolution_UpdateViaIdentityExpanded.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/cmdlets/UpdateAzMonitorLogAnalyticsSolution_UpdateViaIdentityExpanded.cs @@ -6,19 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Cmdlets; using System; - /// Update the tags of a solution. + /// update the tags of a solution. /// /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationsManagement/solutions/{solutionName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzMonitorLogAnalyticsSolution_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolution))] - [global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Description(@"Update the tags of a solution.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolution))] + [global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Description(@"update the tags of a solution.")] [global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.HttpPath(Path = "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationsManagement/solutions/{solutionName}", ApiVersion = "2015-11-01-preview")] public partial class UpdateAzMonitorLogAnalyticsSolution_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 UpdateAzMonitorLogAnalyticsSolution_UpdateViaIdentityExpand /// 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 properties of a Solution that can be patched. - private Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPatch _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.SolutionPatch(); + private Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPatch _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.SolutionPatch(); + + /// + /// 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.MonitoringSolutions.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.MonitoringSolutions Client => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Module.Instance.ClientAPI; @@ -55,6 +73,9 @@ public partial class UpdateAzMonitorLogAnalyticsSolution_UpdateViaIdentityExpand [global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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] @@ -89,7 +110,7 @@ public partial class UpdateAzMonitorLogAnalyticsSolution_UpdateViaIdentityExpand /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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,32 +137,32 @@ public partial class UpdateAzMonitorLogAnalyticsSolution_UpdateViaIdentityExpand ReadOnly = false, Description = @"Resource tags", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPatchTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionPatchTags Tag { get => _parametersBody.Tag ?? null /* object */; set => _parametersBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPatchTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionPatchTags Tag { get => _parametersBody.Tag ?? null /* object */; set => _parametersBody.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.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageError /// 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.MonitoringSolutions.Models.Api20151101Preview.ISolution + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolution /// 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) @@ -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.MonitoringSolutions.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.MonitoringSolutions.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.MonitoringSolutions.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -300,7 +351,7 @@ protected override void ProcessRecord() await ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } if (InputObject?.Id != null) { - await this.Client.SolutionsUpdateViaIdentity(InputObject.Id, _parametersBody, onOk, onDefault, this, Pipeline); + await this.Client.SolutionsUpdateViaIdentity(InputObject.Id, _parametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode.IncludeUpdate); } else { @@ -317,13 +368,13 @@ protected override void ProcessRecord() { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SolutionName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - await this.Client.SolutionsUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.SolutionName ?? null, _parametersBody, onOk, onDefault, this, Pipeline); + await this.Client.SolutionsUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.SolutionName ?? null, _parametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.SerializationMode.IncludeUpdate); } await ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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 } }); @@ -343,7 +394,8 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet + /// class. /// public UpdateAzMonitorLogAnalyticsSolution_UpdateViaIdentityExpanded() { @@ -369,12 +421,12 @@ public UpdateAzMonitorLogAnalyticsSolution_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.MonitoringSolutions.Models.Api20151101Preview.ICodeMessageError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ICodeMessageError /// 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 +443,15 @@ public UpdateAzMonitorLogAnalyticsSolution_UpdateViaIdentityExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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.MonitoringSolutions.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 } }); @@ -409,12 +461,12 @@ public UpdateAzMonitorLogAnalyticsSolution_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.MonitoringSolutions.Models.Api20151101Preview.ISolution + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolution /// 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 ) { @@ -426,8 +478,26 @@ public UpdateAzMonitorLogAnalyticsSolution_UpdateViaIdentityExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolution - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolution + 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/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/Attributes/ExternalDocsAttribute.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/Attributes/ExternalDocsAttribute.cs new file mode 100644 index 000000000000..eb4b85043392 --- /dev/null +++ b/generated/MonitoringSolutions/MonitoringSolutions.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.MonitoringSolutions +{ + 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/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/Attributes/PSArgumentCompleterAttribute.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/Attributes/PSArgumentCompleterAttribute.cs new file mode 100644 index 000000000000..b4a9581d87a3 --- /dev/null +++ b/generated/MonitoringSolutions/MonitoringSolutions.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.MonitoringSolutions +{ + 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/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs index 8891565b56c1..29db4581d496 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.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.MonitoringSolutions.Models"; - private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs index d8ca9a81cdad..e2dde18c5f61 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.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.MonitoringSolutions.Models"; - private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Support"; + private const string SupportNamespace = @"${$project.supportNamespace.fullName}"; protected override void ProcessRecord() { diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs index 60dea70e1c58..3736bf405ce3 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.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/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs index 286324abcf14..90e1cc027629 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.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/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs index a67afc0a03b2..b318074f1c94 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs @@ -12,50 +12,96 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs index b706bddc8af0..9b7305afd182 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.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/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs index 0111d7aea43c..3b52bdef7657 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.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/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs index 0c60c62307a8..11f88c6856e7 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.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.MonitoringSolutions.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.MonitoringSolutions.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.MonitoringSolutions.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/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs index 0931e2c5e77b..194cde19a67c 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs @@ -31,7 +31,7 @@ internal class VariantGroup { public string ModuleName { get; } - public string RootModuleName {get => @"";} + public string RootModuleName { get => @""; } public string CmdletName { get; } public string CmdletVerb { get; } public string CmdletNoun { get; } @@ -49,7 +49,7 @@ internal class VariantGroup public PsHelpInfo HelpInfo { get; } public bool IsGenerated { get; } public bool IsInternal { get; } - + public bool IsModelCmdlet { get; } public string OutputFolder { get; } public string FileName { get; } public string FilePath { get; } @@ -84,7 +84,7 @@ public VariantGroup(string moduleName, string cmdletName, Variant[] variants, st HelpInfo = Variants.Select(v => v.HelpInfo).FirstOrDefault() ?? new PsHelpInfo(); IsGenerated = Variants.All(v => v.Attributes.OfType().Any()); IsInternal = isInternal; - + IsModelCmdlet = Variants.All(v => v.IsModelCmdlet); OutputFolder = outputFolder; FileName = $"{CmdletName}{(isTest ? ".Tests" : String.Empty)}.ps1"; FilePath = Path.Combine(OutputFolder, FileName); @@ -101,12 +101,23 @@ private string DetermineDefaultParameterSetName() if (String.IsNullOrEmpty(defaultParameterSet)) { var variantParamCountGroups = Variants + .Where(v => !v.IsNotSuggestDefaultParameterSet) .Select(v => ( variant: v.VariantName, paramCount: v.CmdletOnlyParameters.Count(p => p.IsMandatory), isSimple: v.CmdletOnlyParameters.Where(p => p.IsMandatory).All(p => p.ParameterType.IsPsSimple()))) .GroupBy(vpc => vpc.isSimple) .ToArray(); + if (variantParamCountGroups.Length == 0) + { + variantParamCountGroups = Variants + .Select(v => ( + variant: v.VariantName, + paramCount: v.CmdletOnlyParameters.Count(p => p.IsMandatory), + isSimple: v.CmdletOnlyParameters.Where(p => p.IsMandatory).All(p => p.ParameterType.IsPsSimple()))) + .GroupBy(vpc => vpc.isSimple) + .ToArray(); + } var variantParameterCounts = (variantParamCountGroups.Any(g => g.Key) ? variantParamCountGroups.Where(g => g.Key) : variantParamCountGroups).SelectMany(g => g).ToArray(); var smallestParameterCount = variantParameterCounts.Min(vpc => vpc.paramCount); defaultParameterSet = variantParameterCounts.First(vpc => vpc.paramCount == smallestParameterCount).variant; @@ -134,7 +145,9 @@ internal class Variant public Parameter[] Parameters { get; } public Parameter[] CmdletOnlyParameters { get; } public bool IsInternal { get; } + public bool IsModelCmdlet { get; } public bool IsDoNotExport { get; } + public bool IsNotSuggestDefaultParameterSet { get; } public string[] Profiles { get; } public Variant(string cmdletName, string variantName, CommandInfo info, CommandMetadata metadata, bool hasParameterSets = false, PsHelpInfo helpInfo = null) @@ -155,6 +168,8 @@ public Variant(string cmdletName, string variantName, CommandInfo info, CommandM Parameters = this.ToParameters().OrderBy(p => p.OrderCategory).ThenByDescending(p => p.IsMandatory).ToArray(); IsInternal = Attributes.OfType().Any(); IsDoNotExport = Attributes.OfType().Any(); + IsModelCmdlet = Attributes.OfType().Any(); + IsNotSuggestDefaultParameterSet = Attributes.OfType().Any(); CmdletOnlyParameters = Parameters.Where(p => !p.Categories.Any(c => c == ParameterCategory.Azure || c == ParameterCategory.Runtime)).ToArray(); Profiles = Attributes.OfType().SelectMany(pa => pa.Profiles).ToArray(); } @@ -210,6 +225,7 @@ public ParameterGroup(string parameterName, Parameter[] parameters, string[] all HasValidateNotNull = Parameters.SelectMany(p => p.Attributes.OfType()).Any(); HasAllowEmptyArray = Parameters.SelectMany(p => p.Attributes.OfType()).Any(); CompleterInfo = Parameters.Select(p => p.CompleterInfoAttribute).FirstOrDefault()?.ToCompleterInfo() + ?? Parameters.Select(p => p.PSArgumentCompleterAttribute).FirstOrDefault()?.ToPSArgumentCompleterInfo() ?? Parameters.Select(p => p.ArgumentCompleterAttribute).FirstOrDefault()?.ToCompleterInfo(); DefaultInfo = Parameters.Select(p => p.DefaultInfoAttribute).FirstOrDefault()?.ToDefaultInfo(this) ?? Parameters.Select(p => p.DefaultValueAttribute).FirstOrDefault(dv => dv != null)?.ToDefaultInfo(this); @@ -244,7 +260,6 @@ internal class Parameter public ParameterMetadata Metadata { get; } public PsParameterHelpInfo HelpInfo { get; } public Type ParameterType { get; } - public Attribute[] Attributes { get; } public ParameterCategory[] Categories { get; } public ParameterCategory OrderCategory { get; } @@ -254,6 +269,7 @@ internal class Parameter public bool SupportsWildcards { get; } public CompleterInfoAttribute CompleterInfoAttribute { get; } public ArgumentCompleterAttribute ArgumentCompleterAttribute { get; } + public PSArgumentCompleterAttribute PSArgumentCompleterAttribute { get; } public bool ValueFromPipeline { get; } public bool ValueFromPipelineByPropertyName { get; } @@ -286,7 +302,8 @@ public Parameter(string variantName, string parameterName, ParameterMetadata met } SupportsWildcards = Attributes.OfType().Any(); CompleterInfoAttribute = Attributes.OfType().FirstOrDefault(); - ArgumentCompleterAttribute = Attributes.OfType().FirstOrDefault(); + PSArgumentCompleterAttribute = Attributes.OfType().FirstOrDefault(); + ArgumentCompleterAttribute = Attributes.OfType().FirstOrDefault(attr => !attr.GetType().Equals(typeof(PSArgumentCompleterAttribute))); ValueFromPipeline = ParameterAttribute.ValueFromPipeline; ValueFromPipelineByPropertyName = ParameterAttribute.ValueFromPipelineByPropertyName; @@ -295,10 +312,10 @@ public Parameter(string variantName, string parameterName, ParameterMetadata met IsMandatory = ParameterAttribute.Mandatory; var complexParameterName = ParameterName.ToUpperInvariant(); - var complexMessage = $"{Environment.NewLine}To construct, see NOTES section for {complexParameterName} properties and create a hash table."; + var complexMessage = $"{Environment.NewLine}"; var description = ParameterAttribute.HelpMessage.NullIfEmpty() ?? HelpInfo.Description.NullIfEmpty() ?? InfoAttribute?.Description.NullIfEmpty() ?? String.Empty; // Remove the complex type message as it will be reinserted if this is a complex type - description = description.NormalizeNewLines().Replace(complexMessage, String.Empty).Replace(complexMessage.ToPsSingleLine(), String.Empty); + description = description.NormalizeNewLines(); // Make an InfoAttribute for processing only if one isn't provided InfoAttribute = Attributes.OfType().FirstOrDefault() ?? new InfoAttribute { PossibleTypes = new[] { ParameterType.Unwrap() }, Required = IsMandatory }; // Set the description if the InfoAttribute does not have one since they are exported without a description @@ -318,7 +335,7 @@ internal class ComplexInterfaceInfo public bool Required { get; } public bool ReadOnly { get; } public string Description { get; } - + public ComplexInterfaceInfo[] NestedInfos { get; } public bool IsComplexInterface { get; } @@ -335,7 +352,7 @@ public ComplexInterfaceInfo(string name, Type type, InfoAttribute infoAttribute, var unwrappedType = Type.Unwrap(); var hasBeenSeen = seenTypes?.Contains(unwrappedType) ?? false; (seenTypes ?? (seenTypes = new List())).Add(unwrappedType); - NestedInfos = hasBeenSeen ? new ComplexInterfaceInfo[]{} : + NestedInfos = hasBeenSeen ? new ComplexInterfaceInfo[] { } : unwrappedType.GetInterfaces() .Concat(InfoAttribute.PossibleTypes) .SelectMany(pt => pt.GetProperties() @@ -366,6 +383,7 @@ internal class CommentInfo public string OnlineVersion { get; } public string[] RelatedLinks { get; } + public string[] ExternalUrls { get; } private const string HelpLinkPrefix = @"https://learn.microsoft.com/powershell/module/"; @@ -391,6 +409,9 @@ public CommentInfo(VariantGroup variantGroup) var moduleName = variantGroup.RootModuleName == "" ? variantGroup.ModuleName.ToLowerInvariant() : variantGroup.RootModuleName.ToLowerInvariant(); OnlineVersion = helpInfo.OnlineVersion?.Uri.NullIfEmpty() ?? $@"{HelpLinkPrefix}{moduleName}/{variantGroup.CmdletName.ToLowerInvariant()}"; RelatedLinks = helpInfo.RelatedLinks.Select(rl => rl.Text).ToArray(); + + // Get external urls from attribute + ExternalUrls = variantGroup.Variants.SelectMany(v => v.Attributes).OfType()?.Select(e => e.Url)?.Distinct()?.ToArray(); } } @@ -420,11 +441,22 @@ public CompleterInfo(ArgumentCompleterAttribute completerAttribute) } } + internal class PSArgumentCompleterInfo : CompleterInfo + { + public string[] ResourceTypes { get; } + + public PSArgumentCompleterInfo(PSArgumentCompleterAttribute completerAttribute) : base(completerAttribute) + { + ResourceTypes = completerAttribute.ResourceTypes; + } + } + internal class DefaultInfo { public string Name { get; } public string Description { get; } public string Script { get; } + public string SetCondition { get; } public ParameterGroup ParameterGroup { get; } public DefaultInfo(DefaultInfoAttribute infoAttribute, ParameterGroup parameterGroup) @@ -432,6 +464,7 @@ public DefaultInfo(DefaultInfoAttribute infoAttribute, ParameterGroup parameterG Name = infoAttribute.Name; Description = infoAttribute.Description; Script = infoAttribute.Script; + SetCondition = infoAttribute.SetCondition; ParameterGroup = parameterGroup; } @@ -479,7 +512,8 @@ public static Parameter[] ToParameters(this Variant variant) parameterHelp = parameterHelp.Where(ph => (!ph.ParameterSetNames.Any() || ph.ParameterSetNames.Any(psn => psn == variant.VariantName || psn == AllParameterSets)) && ph.Name != "IncludeTotalCount"); } var result = parameters.Select(p => new Parameter(variant.VariantName, p.Key, p.Value, parameterHelp.FirstOrDefault(ph => ph.Name == p.Key))); - if (variant.SupportsPaging) { + if (variant.SupportsPaging) + { // If supportsPaging is set, we will need to add First and Skip parameters since they are treated as common parameters which as not contained on Metadata>parameters variant.Info.Parameters["First"].Attributes.OfType().FirstOrDefault(pa => pa.ParameterSetName == variant.VariantName || pa.ParameterSetName == AllParameterSets).HelpMessage = "Gets only the first 'n' objects."; variant.Info.Parameters["Skip"].Attributes.OfType().FirstOrDefault(pa => pa.ParameterSetName == variant.VariantName || pa.ParameterSetName == AllParameterSets).HelpMessage = "Ignores the first 'n' objects and then gets the remaining objects."; @@ -507,7 +541,7 @@ public static ComplexInterfaceInfo ToComplexInterfaceInfo(this InfoAttribute inf public static CompleterInfo ToCompleterInfo(this CompleterInfoAttribute infoAttribute) => new CompleterInfo(infoAttribute); public static CompleterInfo ToCompleterInfo(this ArgumentCompleterAttribute completerAttribute) => new CompleterInfo(completerAttribute); - + public static PSArgumentCompleterInfo ToPSArgumentCompleterInfo(this PSArgumentCompleterAttribute completerAttribute) => new PSArgumentCompleterInfo(completerAttribute); public static DefaultInfo ToDefaultInfo(this DefaultInfoAttribute infoAttribute, ParameterGroup parameterGroup) => new DefaultInfo(infoAttribute, parameterGroup); public static DefaultInfo ToDefaultInfo(this PSDefaultValueAttribute defaultValueAttribute, ParameterGroup parameterGroup) => new DefaultInfo(defaultValueAttribute, parameterGroup); } diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/BuildTime/PsAttributes.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/BuildTime/PsAttributes.cs index 694f1987055a..66c49de5a969 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/BuildTime/PsAttributes.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.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/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/BuildTime/PsExtensions.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/BuildTime/PsExtensions.cs index 7e5fe3f7d52c..79cf8e184abc 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/BuildTime/PsExtensions.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/BuildTime/PsExtensions.cs @@ -13,6 +13,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.PowerSh { 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/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/BuildTime/PsHelpers.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/BuildTime/PsHelpers.cs index 4c483bd2e6f9..4885cfa6bba2 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/BuildTime/PsHelpers.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.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/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/Context.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/Context.cs new file mode 100644 index 000000000000..db2e8aa27cc5 --- /dev/null +++ b/generated/MonitoringSolutions/MonitoringSolutions.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.MonitoringSolutions.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.MonitoringSolutions.Runtime.Extensions; + + /// + /// The IContext Interface defines the communication mechanism for input customization. + /// + /// + /// In the context, we will have client, pipeline, PSBoundParamters, default EventListener, Cancellation. + /// + public interface IContext + { + System.Management.Automation.InvocationInfo InvocationInformation { get; set; } + System.Threading.CancellationTokenSource CancellationTokenSource { get; set; } + System.Collections.Generic.IDictionary ExtensibleParameters { get; } + HttpPipeline Pipeline { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.MonitoringSolutions Client { get; } + } +} diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/Events.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/Events.cs index e8414ea9ddfe..3c78ec73e7b2 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/Events.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.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/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/ISendAsync.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/ISendAsync.cs index b1cbb26e33a8..8d90657477bb 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/ISendAsync.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/ISendAsync.cs @@ -11,6 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.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/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/InfoAttribute.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/InfoAttribute.cs index 73f114e25260..80a250118999 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/InfoAttribute.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.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/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/InputHandler.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/InputHandler.cs new file mode 100644 index 000000000000..6f2ea0fa6514 --- /dev/null +++ b/generated/MonitoringSolutions/MonitoringSolutions.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.MonitoringSolutions.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.MonitoringSolutions.Runtime.IContext context); + } +} \ No newline at end of file diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs index 0a80502ecb3b..b60c673ef106 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.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/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/SerializationMode.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/SerializationMode.cs index c33cdc22f0f8..57ddf9054948 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/SerializationMode.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.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/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/TypeConverterExtensions.cs b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/TypeConverterExtensions.cs index 857365bf27cf..bb67b3d6647f 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/generated/runtime/TypeConverterExtensions.cs +++ b/generated/MonitoringSolutions/MonitoringSolutions.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/MonitoringSolutions/MonitoringSolutions.Autorest/internal/Get-AzMonitorLogAnalyticsOperation.ps1 b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/internal/Get-AzMonitorLogAnalyticsOperation.ps1 index 9095b55e9d6f..2cf8187170d7 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/internal/Get-AzMonitorLogAnalyticsOperation.ps1 +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/internal/Get-AzMonitorLogAnalyticsOperation.ps1 @@ -25,12 +25,12 @@ Lists all of the available OperationsManagement Rest API operations. {{ Add code here }} .Outputs -Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperation +Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperation .Link https://learn.microsoft.com/powershell/module/az.monitoringsolutions/get-azmonitorloganalyticsoperation #> function Get-AzMonitorLogAnalyticsOperation { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperation])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperation])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter()] @@ -89,12 +89,18 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ List = 'Az.MonitoringSolutions.private\Get-AzMonitorLogAnalyticsOperation_List'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/internal/New-AzMonitorLogAnalyticsSolution.ps1 b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/internal/New-AzMonitorLogAnalyticsSolution.ps1 index c974d4a4dbd7..548c5af2cc01 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/internal/New-AzMonitorLogAnalyticsSolution.ps1 +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/internal/New-AzMonitorLogAnalyticsSolution.ps1 @@ -16,20 +16,20 @@ <# .Synopsis -Creates or updates the Solution. +create the Solution. .Description -Creates or updates the Solution. +create the Solution. .Example $workspace = Get-AzOperationalInsightsWorkspace -ResourceGroupName azureps-manual-test -Name monitoringworkspace-2vob7n New-AzMonitorLogAnalyticsSolution -Type Containers -ResourceGroupName azureps-manual-test -Location $workspace.Location -WorkspaceResourceId $workspace.ResourceId .Outputs -Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolution +Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolution .Link https://learn.microsoft.com/powershell/module/az.monitoringsolutions/new-azmonitorloganalyticssolution #> function New-AzMonitorLogAnalyticsSolution { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolution])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolution])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -108,7 +108,7 @@ param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionTags]))] [System.Collections.Hashtable] # Resource tags ${Tag}, @@ -175,13 +175,14 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ CreateExpanded = 'Az.MonitoringSolutions.private\New-AzMonitorLogAnalyticsSolution_CreateExpanded'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -190,6 +191,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/MonitoringSolutions/MonitoringSolutions.Autorest/internal/ProxyCmdletDefinitions.ps1 b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/internal/ProxyCmdletDefinitions.ps1 index 592bbc9a9ce3..d05c50e2c9e8 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/internal/ProxyCmdletDefinitions.ps1 +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/internal/ProxyCmdletDefinitions.ps1 @@ -25,12 +25,12 @@ Lists all of the available OperationsManagement Rest API operations. {{ Add code here }} .Outputs -Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperation +Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperation .Link https://learn.microsoft.com/powershell/module/az.monitoringsolutions/get-azmonitorloganalyticsoperation #> function Get-AzMonitorLogAnalyticsOperation { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.IOperation])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.IOperation])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter()] @@ -89,12 +89,18 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ List = 'Az.MonitoringSolutions.private\Get-AzMonitorLogAnalyticsOperation_List'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -126,20 +132,20 @@ end { <# .Synopsis -Creates or updates the Solution. +create the Solution. .Description -Creates or updates the Solution. +create the Solution. .Example $workspace = Get-AzOperationalInsightsWorkspace -ResourceGroupName azureps-manual-test -Name monitoringworkspace-2vob7n New-AzMonitorLogAnalyticsSolution -Type Containers -ResourceGroupName azureps-manual-test -Location $workspace.Location -WorkspaceResourceId $workspace.ResourceId .Outputs -Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolution +Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolution .Link https://learn.microsoft.com/powershell/module/az.monitoringsolutions/new-azmonitorloganalyticssolution #> function New-AzMonitorLogAnalyticsSolution { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolution])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolution])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -218,7 +224,7 @@ param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.Api20151101Preview.ISolutionTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Models.ISolutionTags]))] [System.Collections.Hashtable] # Resource tags ${Tag}, @@ -285,13 +291,14 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ CreateExpanded = 'Az.MonitoringSolutions.private\New-AzMonitorLogAnalyticsSolution_CreateExpanded'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.MonitoringSolutions.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -300,6 +307,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/MonitoringSolutions/MonitoringSolutions.Autorest/resources/README.md b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/resources/README.md new file mode 100644 index 000000000000..937f07f8fec2 --- /dev/null +++ b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/resources/README.md @@ -0,0 +1,11 @@ +# Resources +This directory can contain any additional resources for module that are not required at runtime. This directory **does not** get packaged with the module. If you have assets for custom implementation, place them into the `..\custom` folder. + +## Info +- Modifiable: yes +- Generated: no +- Committed: yes +- Packaged: no + +## Purpose +Use this folder to put anything you want to keep around as part of the repository for the module, but is not something that is required for the module. For example, development files, packaged builds, or additional information. This is only intended to be used in repositories where the module's output directory is cleaned, but tangential resources for the module want to remain intact. \ No newline at end of file diff --git a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/test-module.ps1 b/generated/MonitoringSolutions/MonitoringSolutions.Autorest/test-module.ps1 index 0080fba9641b..f599d2a349c4 100644 --- a/generated/MonitoringSolutions/MonitoringSolutions.Autorest/test-module.ps1 +++ b/generated/MonitoringSolutions/MonitoringSolutions.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-------------'